3.P6 Reading the Evaluation Results
[video] /api/lesson-media/videos/9b417aa2-5e9f-4ae3-a9db-2a3b7f03f372-1794878471553-2fc324598d4dceb1.mp4
[markdown] content available only on the platform
[markdown] content available only on the platform
Flashcards · 3.P6 Reading the Evaluation Results
Support — The number of true samples of each class in the test set.
Class 0: 100, class 1: 54.
Macro average — The plain mean of a metric over classes, giving every class equal weight.
(0.79 + 0.71) / 2 = 0.75
Weighted average — The mean of a metric over classes weighted by each class's support.
(0.79*100 + 0.71*54) / 154 = 0.76
Per-class row — Each class row of the report treats that class as the positive class.
Row 1: precision 0.71, recall 0.56.
scikit-learn confusion matrix layout — Rows are true labels and columns are predictions; for 0/1 labels it is [[TN, FP], [FN, TP]].
[[88, 12], [24, 30]]
False negative in screening — A patient with the disease predicted as healthy; the most serious error in screening.
24 diabetes patients missed.
Hidden weakness of accuracy — A decent overall accuracy can conceal poor recall on the minority class.
Accuracy 0.77 but class 1 recall 0.56.
cm.ravel() — Flattens a 2x2 confusion matrix so its cells can be unpacked as tn, fp, fn, tp.
tn, fp, fn, tp = cm.ravel()
