07 - classification metrics

simple metrics

actually failure actually normal
predicted failure 40 90
predicted normal 10 860
accuracy

  • accuracy is the fraction of all predictions that were correct:
accuracy=TP+TNTP+TN+FP+FN

recall/sensitivity

  • recall measures how many of the actual positives were detected:
recall=TPTP+FN

precision

  • precision is how often the model's predicted positive is actually positive:
precision=TPTP+FP

specificity/TNR

  • specificity measures how many of the actual negatives were correctly identified:
specificity=TNTN+FP

FPR

  • the false positive rate (FPR):
FPR=1TNR=FPFP+TN

F1 score

F1

  • the F1 score is the harmonic mean of precision and recall that balances these two scores:
F1=2precision×recallprecision+recall=2TP2TP+FP+FN

thresholds

ROC curve

ROC curve.png|500
image: Evidently AI

precision-recall curve

multiclass classification

confusion matrix.png|500