21 — Core Math

Evaluation Metrics#

Evaluation✓ Mathematical
◆ The PatternHow to actually measure if your model is good

Accuracy alone is misleading for imbalanced classes. Precision, Recall, F1 and ROC-AUC give a complete picture.

Precision = TP/(TP+FP)    Recall = TP/(TP+FN)
Precision = of predicted positives, how many real?  |  Recall = of real positives, how many found?
F1 = 2·(Precision·Recall)/(Precision+Recall)
Harmonic mean — punishes models that sacrifice one for the other
// Interactive confusion matrix
True Positives80
False Positives10
False Negatives20
Pattern bridge: Precision and recall trade off like Type I and Type II errors in hypothesis testing. In markets, a MACD signal has the same tradeoff: too sensitive (false positives) vs. too slow (missed moves).
← Previous
Cross-Validation
Open in the full reader, with the topic sidebar →