Skip to content

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.

Advanced ~12 min8 steps

What runs in CodeSplash

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

Read first

01

From "the model disagrees" to an estimate

Read

The 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.

02

Thresholds and the confident joint

Read

For each class jj, the threshold is the model's average probability of jj on the rows labeled jj:

tj=1∣{i:y~i=j}∣∑i:y~i=jp^i(j).t_j=\frac{1}{\lvert\{i:\tilde y_i=j\}\rvert}\sum_{i:\tilde y_i=j}\hat p_i(j).

A row confidently belongs to class jj when p^i(j)≥tj\hat p_i(j)\ge t_j. Counting rows by given label ii and confident class jj gives the confident jointConfident jointA table counting rows by recorded label and the class the model confidently assigns them, rescaled to the label counts. CijC_{ij}; 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?

0.50
How sure?
0.20

Each flipped label moves to the next class (A → B → C → A).

10

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.

0.80

SD of each class around its center; larger means more overlap.

flagged 25real flips 23precision 0.76 · recall 0.83

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 first; the figure appears when you commit.

Make your prediction to see the result.

03

Ranking and what's flagged

Read

For 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.

04

Why out-of-fold?

Predict

Predict first

You run confident learning on a flexible model's predictions on its own training rows instead of out-of-fold predictions. What happens?

It works about as wellIt finds almost nothing
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.

05

Reviewing flags honestly

Read

A 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.

06

Where it stands in CodeSplash

Read
EntryIn 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.
07

Check your understanding

Checkpoint

Check 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.

08

Do it on your own data

In the app

Open 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