A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Classification Metrics and Evaluation

Graduate Depth 93 in the knowledge graph I know this Set as goal
1topic build on this
539prerequisites beneath it
See this on the map →
Supervised Learning FundamentalsConditional Probability+1 moreROC Curves and AUC Metrics
metrics evaluation performance

Core Idea

Classification metrics quantify performance beyond accuracy. Precision measures false positive rate; recall measures false negatives. F1 balances both. Macro-averaging treats all classes equally; weighted-averaging accounts for class frequency. Metric choice depends on problem costs: precision matters when false positives are expensive, recall when false negatives are costly.

Explainer

From supervised learning, you know that a classifier learns to assign inputs to categories — spam or not spam, malignant or benign, cat or dog. The natural first question is "how often does it get the right answer?" and accuracy (correct predictions / total predictions) seems like the obvious metric. But accuracy hides critical information. Imagine a disease screening test where only 1% of patients are actually sick. A classifier that always predicts "healthy" achieves 99% accuracy — yet it is completely useless because it misses every sick patient. This is the fundamental problem that motivates the richer set of classification metrics.

The foundation is the confusion matrix, a table that cross-tabulates predictions against reality. For a binary classifier, it has four cells: true positives (TP — correctly predicted positive), true negatives (TN — correctly predicted negative), false positives (FP — predicted positive but actually negative, also called Type I errors), and false negatives (FN — predicted negative but actually positive, Type II errors). Every classification metric is some combination of these four numbers. Precision = TP / (TP + FP) answers: "Of everything the model flagged as positive, how many actually were?" Recall (also called sensitivity) = TP / (TP + FN) answers: "Of all the actual positives, how many did the model catch?" These two metrics trade off against each other — you can achieve perfect recall by predicting everything as positive (but precision collapses), or perfect precision by only predicting positive when you're extremely confident (but recall collapses).

The F1 score = 2 × (precision × recall) / (precision + recall) is the harmonic mean of precision and recall, providing a single number that balances both. The harmonic mean is used instead of the arithmetic mean because it penalizes extreme imbalances: if either precision or recall is very low, F1 will also be low, even if the other is high. For problems where false positives and false negatives have different costs, you can use the Fβ score, which weights recall β times more than precision. In practice, which metric to prioritize depends on the stakes: a spam filter should favor precision (annoying to lose a real email), while a cancer screening test should favor recall (dangerous to miss a malignant case).

When you move beyond binary classification to multiple classes, you need strategies for combining per-class metrics. Macro-averaging computes the metric independently for each class and then takes the unweighted mean — this treats all classes as equally important regardless of their frequency. Weighted averaging weights each class's metric by its proportion in the dataset — this reflects overall performance but can obscure poor performance on rare classes. Micro-averaging pools all TP, FP, and FN across classes before computing the metric, which in the multiclass case reduces to accuracy. Choosing the right averaging method depends on whether you care equally about all classes (use macro) or proportionally to their frequency (use weighted). Understanding these distinctions is essential for honest model evaluation, especially in real-world datasets where class imbalance is the norm rather than the exception.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersDividing IntegersUnit RatesProportionsPercent ConceptConverting Between Fractions, Decimals, and PercentsOperations with Rational NumbersTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionSine, Cosine, and Tangent RatiosTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIndefinite IntegralsBasic Integration RulesRiemann SumsDefinite Integral DefinitionProbability Density Functions and Continuous DistributionsCumulative Distribution FunctionsContinuous Random VariablesProbability Density FunctionsExpected ValueWeak Law of Large NumbersProbability Axioms and RulesConditional ProbabilityClassification Metrics and Evaluation

Longest path: 94 steps · 539 total prerequisite topics

Prerequisites (3)

Leads To (1)