scikit-learn: Metrics

accuracy_score, classification_report, mean_squared_error — and when each lies

40 min · interactive lesson with runnable code and 5 graded exercises.

What you'll be able to do

  • Explain why accuracy fails on imbalanced data
  • Derive precision, recall and F1 from a confusion matrix
  • Read a classification_report, including macro vs weighted averages
  • Report RMSE and MAE against a mean baseline

The full lesson is free with an account.

Accuracy

The confusion matrix

classification_report

Regression: MSE, RMSE, MAE

Which metric for which job

Pitfalls