Confident learning: estimating which labels are wrong
Confident learning uses out-of-fold probabilities and per-class thresholds to estimate label confusion and flag the likeliest mislabeled rows. Its assumptions, and how to review flags without corrupting evaluation.
What runs in CodeSplash
- ROB007Confident learning Runs in CodeSplash (Predict)
You will be able to
- Compute per-class thresholds and the confident joint from out-of-fold probabilities
- State the class-conditional noise assumption and when it fails
- Measure flag precision with human review instead of trusting the count
- Keep training-set cleaning separate from test-set adjudication
From "the model disagrees" to an estimate
ReadThe simplest way to find wrong labels is to flag rows where the model disagrees with the label. That flags far too many: every hard case and every model mistake. Confident learningConfident learningFinds likely label errors by comparing each row's label with classes the model predicts above that class's average confidence. is more careful. It estimates how many rows of each given label truly belong to each class, and flags only that many, choosing the clearest cases.
Its input is one thing: class probabilities for every row from a model that didn't train on that row, out-of-fold predictions from cross-validation.
Thresholds and the confident joint
ReadFor each class , the threshold is the model's average probability of on the rows labeled :
A row confidently belongs to class when . Counting rows by given label and confident class gives the confident jointConfident jointA table counting rows by recorded label and the class the model confidently assigns them, rescaled to the label counts. ; rescaled to the label counts, its off-diagonal cells estimate the mislabeled rows. In the reference's four-row example the thresholds are 0.550 and 0.800, and one row, labeled class 0 but given class 1 a probability above that class's threshold, is the candidate.
Inject label noise and compare the flagged rows with the flips you made.
HExplorable · Finding mislabeled rows: confident learning
Some labels are wrong. Can a model's own out-of-fold probabilities point to which ones?
Of the rows confident learning flags, what share are really mislabeled?
Each flipped label moves to the next class (A → B → C → A).
The model is k-nearest neighbors; its class probabilities are neighbor shares, lightly smoothed.
Probabilities from
Out of fold: each row scored by a model that never saw it (5 folds). In sample: the model saw the row's own label.
SD of each class around its center; larger means more overlap.
Shapes and colors show the label each row was given. Red outlines mark the rows whose label was really flipped; rings mark what confident learning flags. Rings without red are correct labels it suspects; red without a ring are flips it missed.
Commit your prediction above to see the result
Make your prediction to see the result.
Ranking and what's flagged
ReadFor each pair of classes, the rows with the largest margin toward the other class are flagged, as many as the joint estimates. Rows the model predicts as their own label are never flagged. Flags are ordered by self-confidenceSelf-confidenceThe model's out-of-fold probability for a row's recorded label; the lower it is, the more suspicious the label., the probability of the given label, lowest first.
The method's guarantees rest on class-conditional noise: the chance a label is wrong depends on the true class, not on the individual row. Annotators who struggle with particular kinds of rows (blurry images, borderline cases) break that, as do open-set rows that belong to no listed class.
Why out-of-fold?
PredictPredict first
You run confident learning on a flexible model's predictions on its own training rows instead of out-of-fold predictions. What happens?
Reveal
It finds almost nothing. A model that memorized its training rows agrees with every label, wrong ones included, so its in-sample probabilities are overconfident in the given labels. Only probabilities from models that never saw a row can question that row's label.
Reviewing flags honestly
ReadA flag is a reason to look. Measure how often flags are right: review a stratified sample of flagged and unflagged rows, and estimate precision and recall with human judgments. Rare but valid examples get flagged; ambiguous rows may have no right answer.
Keep a record: original label, adjudicated label and the reason. Clean the training set; treat the test set separately. Editing test labels guided by the model you're evaluating builds a new benchmark that favors that model. If you do adjudicate test labels, do it blind to model predictions and report both scores.
Where it stands in CodeSplash
Read| Entry | In CodeSplash |
|---|---|
| Confident learning (ROB007) | Runs on the Predict run page's Label issues tab, computed on the host from a classification run's out-of-fold probabilities (cleanlab's defaults); you decide keep, relabel or drop, and Apply writes a Prepare step |
It isn't a registry method, so the readiness badge reads "Runs in CodeSplash (Predict)". The app never changes a label by itself.
Reference · ROB007 · Runs in CodeSplash (Predict)Confident learningEstimate label-quality structure using out-of-sample class probabilities, class-specific thresholds, confident counts, calibration, and ranking. It supports targeted review of suspected label issues.Check your understanding
CheckpointCheck yourself
How is the threshold for class j defined?
Show the answer
Answer: b
Each class gets its own bar: how confident the model usually is when the label is j. That adapts to classes the model finds harder.
Check yourself
Which situation breaks confident learning's main assumption?
Show the answer
Answer: b
The guarantees assume class-conditional noise. Row-dependent noise and open-set rows can look like label errors, or hide them.
Check yourself
Confident learning flags 300 rows. What should you report?
Show the answer
Answer: b
Flags are estimates. Human-confirmed precision and recall tell you how far to trust them.
Check yourself
Why is fixing test labels guided by your model's flags risky?
Show the answer
Answer: a
Clean training data freely; adjudicate test labels blind to predictions, and report the original and adjudicated scores.
Do it on your own data
In the appOpen a finished classification run in Predict, choose Label issues, review the top flags, and decide row by row. Before applying, review a sample of unflagged rows too, so you know how much the flags miss.
Concepts in this lesson