Classifier metrics
Confusion matrix & ROC explorer
Drag the threshold and watch the confusion matrix, precision, recall, F1
and the dot on the ROC / PR curves update together. Pick a preset classifier
(strong, weak, imbalanced, …) or paste your own
y_true,y_score CSV.
Confusion matrix
Predicted Positive
Predicted Negative
Actual Positive
TP
0
Correctly flagged
FN
0
Missed positives
Actual Negative
FP
0
False alarms
TN
0
Correctly cleared
Metrics at this threshold
ROC curve AUC: —
x = False Positive Rate · y = True Positive Rate · dashed = random classifier · dot = current threshold.
Precision–Recall curve AP: —
x = Recall · y = Precision · dashed = baseline (positive prevalence) · dot = current threshold.
Score distribution
Histogram of predicted scores split by true class — drag the threshold above to see how the cut line slices the populations.
Formulas under the hood
- Accuracy = (TP + TN) / N
- Precision = TP / (TP + FP) — of everything we flagged, how much was real?
- Recall (TPR / sensitivity) = TP / (TP + FN) — of all real positives, how many did we catch?
- Specificity = TN / (TN + FP) FPR = 1 − Specificity
- F1 = 2 · Precision · Recall / (Precision + Recall)
- ROC AUC = area under the (FPR, TPR) curve — threshold-independent ranking quality.
- Average Precision = area under the Precision–Recall curve — more informative on imbalanced datasets.