Sub topic 1
Why labels arrive late
Prerequisites
This chapter assumes you know the following:
- Binary classification metrics: accuracy, precision, recall and ROC AUC.
- Basic Python, pandas and scikit-learn.
- Train, validation and test splits.
- What a deployed model's prediction log is: a table with one row per prediction, holding an id, a timestamp, the input features and the score.
You do not need any monitoring tools. This chapter builds the vocabulary for the rest of the tutorial.
What label delay is
A label is the true outcome for a prediction. In a notebook, labels sit next to features, so you compute accuracy or AUC immediately. In production the outcome often happens later than the prediction. The time between the two is the label delay, also called feedback lag.
Some examples:
| Use case | Prediction made | Label arrives | Typical delay |
|---|---|---|---|
| Card fraud | At payment | When the cardholder disputes or a chargeback is filed | Days to 120 days |
| Credit default | At loan approval | When a payment is missed for 90 days | Months |
| Churn | At month start | When the customer fails to renew | Weeks to months |
| Ad click | At ad display | When the user clicks | Seconds to minutes |
| Demand forecast | At planning time | When the sales are recorded | Days to weeks |
The delay is not a single number. It is a distribution. Most chargebacks may arrive in 30 days, but a long tail arrives at 90 or 120 days. Any monitoring design must account for that tail.
Why delays happen
Labels are late for different reasons, and the reason determines how you should handle them.
- The outcome takes time to happen. A loan cannot default on day one. The event you predict lies in the future by design.
- The outcome takes time to observe. A fraudulent charge occurs immediately, but nobody knows until the customer reads a statement.
- The outcome takes time to confirm. A fraud analyst may need a week to investigate a flagged case.
- The label pipeline is slow. Data from a partner or a batch system may land in your warehouse in a weekly load.
- The label is never observed for some cases. A declined loan applicant never shows whether they would have repaid. This is a different problem, covered in a later chapter on censoring and selection bias.
The first three are properties of the domain. The fourth is an engineering problem you can sometimes reduce. The fifth cannot be fixed by waiting.
The monitoring gap
Suppose a fraud model has labels that mostly arrive within 60 days. Today you can compute true performance only for predictions made at least 60 days ago. Anything newer is unscored or only partially scored. This is the monitoring gap: the period between the most recent prediction and the most recent prediction whose label is trustworthy.
If the model breaks today, for example because an upstream feature starts returning zeros, the damage appears in the predictions immediately. The metrics that reveal it appear 60 days later. In that time the model may make a large number of bad decisions.
Why naive metrics mislead
The obvious approach is to join the prediction log with whatever labels exist and compute a metric. This fails in a predictable way.
Consider fraud labels. Fraud that is detected quickly appears in the label table early. Slow-to-detect fraud appears late. If you compute recall on last week's predictions today, the label table contains only the quick-to-detect frauds. Missing labels are usually read as negatives, so the metric changes in two ways:
- Frauds that have not been reported yet count as legitimate. Your model's true positives are undercounted if they are among the unreported ones, and its false positives are overcounted.
- The fraud rate in the recent window looks lower than it really is.
The result is a metric that looks worse or better than the truth, and the error shrinks as time passes. Plotted over time, the most recent points sag or jump for no real reason. Teams often chase this artifact as if it were model degradation.
The following code shows the effect with simulated data. Each case has a delay drawn from an exponential distribution. We "look" at the data 30 days after the end of each weekly cohort and compare the apparent positive rate with the true one.
import numpy as np
import pandas as pd
rng = np.random.default_rng(0)
n = 20000
df = pd.DataFrame({
"predicted_at": pd.Timestamp("2026-01-01")
+ pd.to_timedelta(rng.integers(0, 120, n), unit="D"),
"is_fraud": rng.random(n) < 0.05,
})
# Label delay in days for the fraud cases: mean 25 days, long tail.
df["delay_days"] = rng.exponential(25, n)
df["label_at"] = df["predicted_at"] + pd.to_timedelta(df["delay_days"], unit="D")
now = pd.Timestamp("2026-05-01")
# Only fraud that has been reported by "now" shows up as a positive label.
df["observed_fraud"] = df["is_fraud"] & (df["label_at"] <= now)
df["week"] = df["predicted_at"].dt.to_period("W")
summary = df.groupby("week").agg(
true_rate=("is_fraud", "mean"),
observed_rate=("observed_fraud", "mean"),
)
print(summary.tail(6).round(4))For weeks long before now, both columns are close to 0.05. In the last weeks, observed_rate falls toward zero while true_rate stays near 0.05. Nothing about the model or the world changed. Only the labels are missing.
Label delay is not the same as missing data
Two situations look alike but need different handling.
- Delayed labels: the outcome will arrive. The label table is incomplete now, and complete later. Waiting works.
- Missing labels: the outcome may never arrive, or arrives only for a biased subset. Waiting does not fix this.
In many systems the absence of a label is itself the signal. For example, "no chargeback within 120 days" is treated as a negative. That is a modeling assumption, not an observation, and it holds only after the delay distribution has been mostly exhausted. Later chapters introduce the maturity window, which is the time after which you accept that rule.
Measuring your own delay distribution
Before designing any monitoring, measure the delay. You need the time between prediction and label for cases whose labels have arrived. Be careful here: if you only look at labels that have arrived, you see short delays more often. Restrict the analysis to old enough cohorts to reduce this bias.
import pandas as pd
def delay_quantiles(df: pd.DataFrame, now: pd.Timestamp,
min_age_days: int = 120):
"""Delay quantiles for positives, using only cohorts old enough to be nearly complete.
df: columns predicted_at, label_at (NaT if not yet labeled), is_positive
"""
old = df[(df["predicted_at"] <= now - pd.Timedelta(days=min_age_days))
& df["is_positive"]]
delay = (old["label_at"] - old["predicted_at"]).dt.total_seconds() / 86400
return delay.quantile([0.5, 0.9, 0.95, 0.99]).round(1)Read the result as follows. The median tells you when half of the labels are in. The 95th or 99th percentile tells you how long you wait for nearly all of them. A large gap between the median and the 99th percentile means a long tail, and you should plan for it.
Also check whether the delay depends on the case. Delay often varies by segment: card-present payments may be disputed faster than online ones, and large loans may be reviewed more slowly. If the delay differs by segment, a metric computed on partial labels is biased by segment mix as well as by time.
Common errors
- Treating the latest metric as final. A metric computed on young data will be revised as labels arrive. Report it with its age or its label coverage.
- Reading missing labels as negatives too early. This inflates accuracy and deflates recall in recent windows.
- Using one delay number. The mean delay hides the tail. Use quantiles.
- Measuring delay from labeled rows only, in recent data. This shows short delays and underestimates the true lag.
- Assuming the delay is stable. A new fraud-review process, a partner change, or a holiday backlog can shift the delay distribution. A shift in delay looks like a shift in model performance if you do not track it.
- Ignoring the cost of waiting. Waiting for full maturity is safe for the metric but slow for detecting failure. The rest of this tutorial is about closing that gap.
What comes next
The monitoring gap forces a choice between two bad options: wait for labels and learn about failures late, or use immature labels and get biased metrics. The following chapters give a way out. First you will define a maturity window and evaluate by prediction time. Then you will use label-free signals such as drift and calibrated probabilities to estimate performance in the gap. Finally you will check those estimates against the labels once they arrive.
Exercise
A churn model predicts at the start of each month whether a customer will cancel within 60 days. Today is the 20th. You compute recall on the predictions made on the 1st of this month using cancellations recorded so far, and the number is much lower than last quarter. List two explanations that do not involve the model getting worse, and say what you would check for each.
Show answer
First, label delay. The 60-day outcome window has not closed, so many customers who will cancel have not yet done so, and they count as negatives. Check by computing recall for a cohort whose 60 days have fully passed, and compare the recall of earlier cohorts at the same age (20 days after prediction) rather than at full maturity. Second, a change in the delay distribution or in the label pipeline, for example a billing system that now records cancellations later. Check by comparing the quantiles of the delay between prediction and cancellation across recent and older cohorts, and by looking for a gap in the label table load times.