EasyDeepLearn

How do you read a confusion matrix and derive the key metrics?

easy

Answer

  • Rows = actual class, columns = predicted class (or vice versa).
  • Cells: TP, FP, TN, FN.
  • Accuracy = (TP+TN)/all.
  • Precision = TP/(TP+FP).
  • Recall = TP/(TP+FN).
  • Specificity = TN/(TN+FP).
  • F1 = 2·P·R/(P+R).
  • Read it to see which class the model confuses with which — a diagonal-heavy matrix means good separation.
Check yourself — multiple choice
  • Precision = TP/(TP+FN)
  • Recall = TP/(TP+FP)
  • F1 = 2·Precision·Recall / (Precision+Recall)
  • Accuracy is always the best metric

F1 is the harmonic mean of precision and recall.

#metrics#classification

Practise Supervised Learning

215 interview questions in this topic.

Related questions