Class imbalance occurs when one outcome or category appears much more often than another. In a collection with few relevant items, a method can achieve high overall accuracy by labeling everything ordinary. That headline figure leaves open whether the method finds the rare cases that motivated the examination.
Describe the class counts, identify the mistakes that matter to the intended use, and inspect the denominators behind each measure. A small false-positive rate can produce many false alerts when most items are negative. A test with equal numbers of positives and negatives can still help compare error rates, but its fraction of useful alerts may differ from the casework queue.
Key terms
- Class imbalance
- Unequal representation of classes in a dataset or collection of trials.
- Prevalence
- The proportion of a defined population or set of trials that belongs to the positive class.
- Positive predictive value (PPV)
- The proportion of positive outputs that are true positives, also called precision in binary classification.
- Classification recall
- The proportion of known positive trials correctly identified as positive, also called sensitivity.
Learning Objectives
- Explain how class frequencies affect overall accuracy and the usefulness of positive calls.
- Calculate a majority-class baseline, precision, and recall from counts.
- Interpret evaluation data whose class mix differs from its proposed use.
- Assess how missed cases and false alerts affect forensic review.
Count the Classes Behind Overall Accuracy
Start with a defined task, such as flagging document records that contain a specific review issue. The positive class contains records independently known to have that issue. All independently checked records without it form the negative class. A method's positive calls are a different count. Preserve the definition and units whenever you report class frequencies.
Suppose a validation set contains 10,000 known records and only 100 have the target issue. A rule marking every record negative is correct for the 9,900 records without that issue. Its overall accuracy is 99 percent and it identifies zero relevant records. The rule provides a majority-class baseline that a headline accuracy figure can be compared with.
An actual flagging tool might yield 80 true positives, 20 missed positives, and 99 false positives. It correctly leaves 9,801 negatives unflagged. Its overall accuracy is 98.81 percent, slightly below the all-negative rule, while it finds 80 of the 100 relevant records. Deciding whether it serves its purpose requires considering the missed records and extra review.
When there are several classes, name the important group distinctions and their sizes. One software output may be common even though a specific underlying case type is rare. Combining similar cases for an aggregate estimate can obscure a subgroup's errors. Report whether the important comparison concerns all positives, a particular positive subtype, or an outcome for which no reliable reference label exists.
Class imbalance can occur at different stages. Training data might overrepresent easy positive examples to help a model learn. A curated test can deliberately include difficult cases. The operational review queue can have a different mix again. Record which set a proportion describes. A class ratio manufactured for a study gives no direct estimate of how often the issue occurs outside that design.
Ask what generates an individual trial. A verification set might contain one row per document, while a reference comparison set contains many different-source pairs for each same-source pair. The frequencies of the two outcomes can differ sharply across these designs. Describe how records or pairs were chosen before applying an observed accuracy percentage to another review task.
Use the Denominator for the Task
Recall divides true positives by all known positives. In the teaching set, 80 of 100 gives 80 percent recall. The false-positive rate divides false positives by known negatives, so 99 of 9,900 gives one percent. The two values describe how the method behaves conditional on the actual classes. Preserve counts so a reader can check the test's workload.
Precision divides true positives by all predicted positives. The teaching tool flags 179 records, including 80 true positives, for precision of about 44.7 percent. This directly addresses the fraction of flags that warrant action under the reference rule. The remaining flags can still consume review capacity. A low false-positive rate and modest precision can occur in the same test.
The manner of use determines which ratios are most important. A reviewer may need most true issues to make it into a queue. A system with limited review time may also need to keep that queue manageable. If positive calls trigger higher-stakes decisions, the cost and interpretation of the false calls change. See intended use for specifying those differences.
Consider how to handle zero predictions. An all-negative rule has recall of zero if known positives exist. Its precision is undefined because there are no predicted positives to serve as the denominator. Record that state explicitly. Inventing a precision value can obscure that the method produced no cases for review at all.
Separate missing reference answers from known negatives. Unreviewed records can contain positives, including in a set where flags are rare. Counting everything unreviewed as negative can make the estimated positive prevalence misleading. If some labels remain unavailable, report how the validation sampled and confirmed cases and where unresolved records enter the denominators.
Explain How a Changed Class Mix Affects Results
Keep the teaching tool's 80 percent recall and one percent false-positive rate, and consider a separate exercise with 1,000 positives and 1,000 negatives. The expected counts at those rates are 800 true positives and 10 false positives. Precision would be about 98.8 percent. With one percent positives in the original exercise it was 44.7 percent, even though the two conditional rates were held fixed.
This standardization exercise assumes that the method's error rates within each class remain comparable. Real changes can affect both the class mix and the difficulty of its cases. One archive may contain many ambiguous documents, while another contains mostly legible forms. The dataset shift lesson describes why a change in population needs evidence about both factors.
A rare class can be deliberately enriched to produce enough positive examples for measuring recall. Document how the enrichment was done and judge whether the selected positives represent the task. A test set filled with severe faults may give a misleading estimate for barely visible ones. Keep the probability of detection specific to the conditions and type of fault examined.
If a representative prevalence estimate is unavailable, report several plausible scenarios or leave operational precision unestimated. Use conditional rates only within the conditions where they were measured. A scenario can show how many reviews would follow at a stated case mix, provided the assumption is clear. It should remain separate from counts actually observed in a test.
Precision can also vary across regions of a ranked list. A short queue may contain mostly clear cases while adding more results admits borderline ones. Stating precision at one limit tells a reviewer about that portion of the output. If the next step examines a different number of records, report the limit and the associated coverage and false alerts for that plan.
Design Evaluation Around the Rare Cases
Sample enough independent positives to support a useful estimate of their detection. Many variants of the same rare source may remain dependent. The count of records then overstates the variety of known positives. Report both the source and trial counts, and identify where the test remains sparse. Small samples and confidence intervals covers the resulting uncertainty.
Include plausible negatives. A positive example can resemble several benign alternatives. A test of document labels should include the same forms with nearby fields, common extra marks, and unrelated dates. Testing only very dissimilar negatives can make the method appear more selective than it is in the intended workflow.
Choose a suitable operating point and report the results there. If the review procedure only examines the first portion of ranked results, measure what can be retrieved within that limit. A curve over many thresholds may summarize ranking behavior. At the planned cutoff, give response counts, review volume, and unresolved outcomes. See similarity scores and candidate rankings for the effects of list limits.
If the workflow sends too many items for review, examine how that affects final errors. A user under time pressure may inspect fewer entries or pay less attention to certain flags. Validation of the combined review process should record how many flags received review and whether it caught missed issues. A manageable queue is a property of the workflow and its class mix.
Report the Result With Scope and Counts
A clear report can say, “The method flagged 80 of the 100 known positives and 99 of the 9,900 known negatives. Eighty of its 179 flags were correct in this test.” If that class mix was assembled for evaluation, state that fact. Add how unreadable or unresolved cases were treated before carrying figures into a decision.
Compare against a baseline relevant to the goal. A no-flag rule gives zero recall for known positives. A simple manual triage checklist may offer another useful comparison if its results and coverage are available. State what each baseline does and compare the error types and effort under comparable conditions. An unexplained baseline can exaggerate the apparent value of a complex score.
Use visual summaries with the same care as numerical ones. A receiver operating characteristic curve shows recall against false-positive rate across thresholds. A precision-recall curve displays how many flags are correct at different levels of coverage. The latter depends on class prevalence. Neither curve replaces counts and outcomes at the actual decision threshold or review limit.
Monitor the case mix when new material differs from evaluation. Report changes in sources, capture conditions, and the estimated fraction of positives when these can be established. Do not infer prevalence solely from flags generated by the same classifier. An independently checked sample can help reveal changes in both the frequency of positives and the method's behavior.
Report distinct outcomes even when a headline average is required. A method may perform well on common pages while often missing a rare approval stamp, and the cost of that miss may dominate the workflow. A small table of class counts and dispositions gives readers a way to check which cases the average represented and which failures need separate attention.
Can a method have high accuracy and miss every positive?
Does a low false-positive rate imply most flags are correct?
Is a balanced dataset unsuitable for validation?
How do unresolved records affect class metrics?
Check Your Understanding
Source
- 1.Saito and Rehmsmeier, The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced DatasetsReports the published simulation, class counts, and re-evaluation that illustrate the effect of class mix on performance measures.