Concepts / Reading Per-Class Evaluation Results

Reading Per-Class Evaluation Results

An eval set measures a model's performance, so its composition and labels shape the score you see.

  • Programming

A Team Blames the Model

Imagine a delivery team reporting that their model passes some kinds of cases and fails others. The natural first reaction is to suspect the model itself. Maybe it needs more training, a different architecture, or more tuning. That reaction is understandable, but it skips a question that matters just as much. The scores come from an evaluation set, and the evaluation set was built by people choosing which cases to include and how each case was labeled. If that set is flawed, the scores can point in the wrong direction.

What do you think happens?

A model scores well on two case classes and poorly on the other two. Before blaming the model, what should you check first?

Reveal answer
Answer:

Check the eval set first: its composition and the labels on its cases.

The source states that uneven results can be a labeling problem or an eval set problem rather than a model problem, and that checking the eval set comes first. The scores come from a set that people built by choosing cases and labeling them, so an honest reading starts by asking whether that set is a fair measuring instrument for the work the model is supposed to do.

This article is about that second question. Before deciding what is wrong with a model, you need to ask whether the eval set is an honest measuring instrument. The sections below follow one line of reasoning: first what an eval set does, then how to tell a labeling problem from a model problem, then how to calibrate the eval set, and finally how to read the report's criteria and judge readiness.

What the Eval Set Measures

An eval set stands in for the real workload. The model is run on its cases, and the scores it produces describe how the model behaves on those cases. That makes the score only as meaningful as the set's contents. A high score on a set that does not resemble real traffic says little about production behavior. A low score on a set that over-represents hard, rare, or mislabeled cases can say even less.

Two things in the eval set shape the number you see. The first is composition: how many cases come from each case class. The second is labels: the correct answer recorded for each case. If composition under-represents a class, the score says little about that class. If labels are wrong for a class, the model can be graded incorrectly on exactly the cases where it is trying to be right.

The source gives a concrete picture of how this goes wrong. The eval set in that project was built from early data, and that early data under-represented two of the four case classes. Those under-represented classes were the ones where the model later struggled. The team's reading was that the eval set and the model's performance were tangled together, and the eval set was not a neutral ruler.

Labeling Problem or Model Problem

When performance is uneven across case classes, there are two broad diagnoses, and they lead to different actions. A model problem suggests changing the model. A labeling problem suggests fixing the eval data first. Because the actions differ, the diagnosis has to come before the fix. The flow below shows the order in which the checks are worth running.

Uneven pass rate byclassIs the eval setrepresentative?Rebuild stratifiedeval setEval set problemRe-label withreviewerLabeling problemAre the labelscorrect?Change the modelModel problemcheck firstnoyesnoyes
If one case class scores poorly, what checks decide whether the labels or the model are at fault, and in what order?

The first check is the eval set itself: does its mix of cases and its labels represent the work the model is supposed to do? Only when the set passes that check does it make sense to ask whether the model is at fault. In the source case, the failing classes shared language patterns that the eval set had underweighted. The team re-labeled forty cases with the customer's lead reviewer, and the model's pass rate on those re-labeled cases reached seventy-eight percent. That result is the evidence the team used to argue the problem lay in the labeling rather than in the model.

Calibrating the Eval Set

Eval set calibration means making the eval set represent the distribution of case classes accurately. A stratified eval set is built against the case-class distribution from the start, rather than from whatever early data happens to be available. The source admits that the team in its project should have done exactly this: stratified the eval set against the customer's case-class distribution from the beginning. Their proposed fix is to run validation against a corrected, stratified eval set rather than the original one.

Worked example

How an underweighted class hides inside a headline number

An eval set has 100 cases: 90 from a common class and 10 from a rare class. The real workload sends the two classes in equal numbers. The reported overall pass rate is 95 percent. Does that number describe production behavior?

  1. 1
    Count the classes in the eval set

    There are 90 common-class cases and 10 rare-class cases, so the rare class is only 10 percent of the set.

  2. 2
    Compare with real traffic

    In the real workload the two classes arrive in equal numbers, so the rare class is half of production traffic. The eval set gives it one-tenth of the weight.

  3. 3
    Ask what the 95 percent mostly measures

    Because 90 of the 100 cases are common-class cases, the headline number is dominated by performance on the common class.

  4. 4
    Consider the rare class

    The rare class could be failing badly while the headline number barely moves, because it contributes only 10 of the 100 cases.

Result

The 95 percent figure is not a trustworthy estimate of production behavior. The aggregate score is only meaningful when the eval set's composition matches the workload it is meant to represent.

Common class: 90casesMajority of the setReported pass rate:95 percentDominated by common classCommon class: 50casesMatches real mixAggregate recomputedReflects both classesRare class: 10casesHalf of real trafficRare class: 50casesMatches real mixdrivesdrivesdrives
How does an eval set whose class mix differs from real production traffic change the aggregate score a reader sees?

The before and after panels show the mechanism. In the original mix, the common class fills most of the set and so most of the headline number. A calibrated set gives each class its real share of the workload, and the aggregate is then recomputed from a mix that reflects production. The point of calibration is not to make the number higher or lower; it is to make the number answer the question you actually care about.

Counts Versus Averages

An evaluation report often mixes two kinds of measurement. Some criteria are reported as a count of cases that cleared the criterion, out of the total number of cases. Other criteria are reported as an average percentage across the cases. The source report uses both forms in the same run, so reading the report correctly means first noticing which form each criterion uses.

C1: 36 of 42 casesHow many cases clearedC2: 73 percentaverageTypical level across casesC4: 28 of 42 casesHow many cases clearedC3: 91 percentaverageTypical level across cases
How do a count-based criterion and a percentage-based criterion differ in what they show for the same underlying results?
Worked example

Reading the baseline run

In a baseline run on 42 test cases, C1 cleared on 36 cases, C4 cleared on 28 cases, C2 averaged 73 percent, and C3 averaged 91 percent. What does each number tell you?

  1. 1
    Identify the form of each criterion

    C1 and C4 are counts of cases out of 42. C2 and C3 are averages across the cases.

  2. 2
    Read the counts as totals

    C1 cleared on 36 of 42 cases and C4 on 28 of 42. A count tells you how many cases passed.

  3. 3
    Read the averages as typical levels

    C2 averages 73 percent and C3 averages 91 percent. An average tells you the typical level across cases.

  4. 4
    Avoid direct comparison

    The two forms cannot be compared directly without converting them to a common scale. A high average also does not mean every case cleared.

Result

Counts and averages answer different questions. The report is only read correctly when each number is interpreted in its own form.

Misses and Hard Fails

A missed case and a hard fail are different outcomes. In the source run, six cases missed a clause under C1. Those six misses are not all equally serious. Two of the missed cases involved material clauses, and those two were classed as hard fails. The other four are recorded as misses without the hard-fail label. The distinction matters because hard fails must be fixed before production rollout.

OutcomeWhat it means in the source runHow it affects the reportWhat must happen before rollout
MissA case missed a clause under C1, without the hard-fail labelCounts against the criterion's countRecorded and tracked
Hard failA miss involving a material clauseCarries the hard-fail label in addition to being a missMust be fixed before production rollout

Misses and hard fails as they appear in the baseline run

Judging Production Readiness

The question an evaluation has to answer is not whether the report contains good numbers, but whether the model as a whole is ready to be used. The aggregate pass rate is compared against the validation threshold, which is a whole-model check. Individual criteria cannot replace it. Each criterion can look acceptable while the aggregate still falls short. The reverse is also worth noticing: the aggregate is a single number, so the criteria beneath it are where you find out why it is low.

Aggregate pass rateSingle summary numberIndividual criteriaShow why the total is lowValidationthresholdWhole-model checkHard failsMust be fixed beforerolloutcompared againstexplainblock rollout
Where does the aggregate pass rate sit relative to the validation threshold, and what does that position imply about readiness?

Mistakes When Reading Eval Reports

  • Common mistake

    Blaming the model before checking the eval set

    What it looks like

    A team sees low pass rates on two classes and immediately plans more training.

    Why it fails

    Uneven results can come from a labeling problem or an eval set problem. The eval set is checked first.

    Do this instead

    Check composition and labels, then decide whether the model needs to change.

  • Common mistake

    Trusting the headline number without looking at the class mix

    What it looks like

    A 95 percent pass rate on a set that is 90 percent common-class cases is reported as production quality.

    Why it fails

    The aggregate mostly describes the common class when the set underweights a rare class that real traffic sends in equal numbers.

    Do this instead

    Compare the eval set's composition with the real workload before trusting the aggregate.

  • Common mistake

    Comparing a count directly with an average

    What it looks like

    Reading C1 at 36 of 42 cases as if it were the same kind of number as C2 at 73 percent.

    Why it fails

    A count says how many cases passed; an average says the typical level. They need a common scale before comparison.

    Do this instead

    Identify each criterion's form first, then interpret it in its own terms.

  • Common mistake

    Treating every miss as equally serious

    Why it fails

    Some misses involve material clauses and are classed as hard fails, which must be fixed before rollout.

    Do this instead

    Read the hard-fail labels alongside the totals.

Practicing the Reading

MEDIUM

A report on 42 cases shows C1 cleared on 36 cases, C4 cleared on 28 cases, C2 averaged 73 percent, and C3 averaged 91 percent. Six cases missed a clause under C1, and two of those misses were classed as hard fails. Explain which numbers are counts and which are averages, and state whether the hard fails must be resolved before rollout.

Hints
  • Look at whether each criterion is expressed as cases out of 42 or as a percentage across cases.
  • Think about what a hard fail means relative to a plain miss.

Key Takeaways from Eval Reports

  1. 1
    An eval set measures a model's performance, so its composition and labels shape the score you see.
  2. 2
    When results are uneven across classes, check the eval set and its labels before concluding the model is at fault.
  3. 3
    Eval set calibration means making the set's class mix represent the real case-class distribution; an underweighted set can make a headline number misleading.
  4. 4
    Counts and averages answer different questions, and a miss and a hard fail carry different weight; hard fails must be fixed before production rollout.
  5. 5
    Judge readiness by comparing the aggregate pass rate with the validation threshold, and use the individual criteria to explain any shortfall.

At a glance

  • An eval set measures a model's performance, so its composition and labels shape the score you see.
  • When results are uneven across classes, check the eval set and its labels before concluding the model is at fault.
  • Calibration makes the eval set's class mix represent the real case-class distribution; an underweighted set produces misleading aggregates.
  • Counts and averages answer different questions, and hard fails carry more weight than ordinary misses and must be fixed before rollout.
  • Judge readiness by comparing the aggregate pass rate against the validation threshold, and use individual criteria to explain shortfalls.