AI/ML Foundations

Metrics & Evaluation

Metrics convert model behavior into decision-making evidence. The right metric depends on the cost of mistakes, class imbalance, thresholds, slices, and the way the output is used.
  • Accuracy is only safe when classes and mistake costs are balanced
  • Precision answers: when the model says positive, how often is it right?
  • Recall answers: of all real positives, how many did we catch?
  • Thresholds are product decisions
  • Evaluate slices, not just aggregate score
  • LLM evaluation is multi-dimensional
Classification metric cheat sheet
MetricQuestion it answersWatch out
AccuracyHow often correct overall?Misleading on imbalance
PrecisionCan I trust positive predictions?Can hide missed positives
RecallDid we catch the positives?Can hide false alarms
F1Balance precision and recall?Assumes equal importance
PR-AUCRanking quality for rare positives?Harder to explain
CalibrationDo probabilities mean what they say?Different from accuracy
Sources
  • Machine Learning Crash CourseClassification metrics
  • scikit-learn User GuideMetrics and scoring
  • OpenAI API DocumentationEvaluation and production guidance