Evaluation metrics
Step 8 of 21 in Machine Learning · Build · Medium
Accuracy misleads on imbalanced data. Precision, recall, F1 and ROC-AUC show different trade-offs; pick the one that matches the cost of each error.
Build it
Metrics by hand
Confusion matrix, precision, recall, F1 and ROC-AUC by threshold sweep.
Done when: Match sklearn.metrics.
The 99% trap
On a 99:1 dataset show an all-negative model gets 99% accuracy and 0 recall.
Done when: You say which metric you would report.
Resources
- Wikipedia: Precision and recall Article
- ISLR / ISLP (free book) Book
- StatQuest Video
- scikit-learn: model evaluation Article
Earn this star
On the map, you log what you built. Finish the step and its star lights.
Open this step on the map