Sub topic 3
Choosing a Label Maturity Window
Assume you understand binary classification metrics, pandas, scikit-learn, train/validation/test splits, and prediction logs. This chapter focuses on a production question: how long must you wait before a prediction’s label is reliable enough to score?
A label maturity window is the amount of time after prediction when the true outcome is expected to be known. For example, a fraud model might need 60 days because chargebacks can arrive weeks after a transaction. A churn model might need 90 days because a customer must remain inactive for a defined period.
Why the window matters
A prediction is not immediately evaluable. If you score yesterday’s predictions, many positive outcomes may not have happened or been recorded yet. Treating missing labels as negative creates optimistic metrics.
The window should reflect the business definition of the label and the observed delay in receiving labels. It is not simply the average delay. A small group of very late labels can still create bias.
Useful questions include:
- When is the outcome considered final?
- How long after prediction do labels usually arrive?
- What percentage of labels is still missing after each possible window?
- Do late labels differ systematically from early labels?
- How much monitoring delay can the business accept?
| Window choice | Benefit | Risk |
|---|---|---|
| Short | Faster feedback | Unmatured labels bias metrics |
| Long | More complete labels | Slow detection of degradation |
| Outcome-specific | Matches each label process | More complex monitoring |
Estimate the window from historical delays
Use historical prediction records where the label arrival time is known. Calculate the delay between predicted_at and labeled_at. Then inspect high percentiles, such as the 95th or 99th percentile.
import pandas as pd
events = pd.DataFrame({
"predicted_at": pd.to_datetime([
"2026-01-01", "2026-01-01", "2026-01-02",
"2026-01-02", "2026-01-03"
]),
"labeled_at": pd.to_datetime([
"2026-01-03", "2026-01-11", "2026-01-05",
"2026-01-21", "2026-01-08"
])
})
events["delay_days"] = (
events["labeled_at"] - events["predicted_at"]
).dt.total_seconds() / 86_400
for percentile in [0.50, 0.90, 0.95, 0.99]:
print(percentile, events["delay_days"].quantile(percentile))A 95th-percentile window means roughly 95% of historically observed labels arrived within that period. It does not guarantee that every future label will arrive on time.
Balance completeness and speed
A practical policy often uses two windows:
- A monitoring window for early estimates, with an explicit coverage value.
- A maturity window for official metric reporting.
For example, you might report an early estimate after 14 days but publish confirmed AUC only after 60 days. The early estimate must not be presented as ground truth.
Use historical cohorts to test candidate windows. For each window, measure label coverage and compare the metric with the metric calculated after labels are fully available. Choose the shortest window whose error stays within an agreed tolerance.
Account for changing delay behavior
Label delays can change when investigation teams, customers, policies, or data pipelines change. Recompute delay distributions regularly. Track coverage by prediction cohort, not only as one overall number.
If outcomes have different delays, use separate windows. A payment reversal and a customer renewal should not share a maturity rule merely because they are both labels.
A window also cannot fix censoring. Censoring occurs when the observation period ends before an outcome has had time to occur. A study ending today will naturally contain more immature predictions than an older study.
Exercise
A fraud label arrives within 30 days for 90% of cases, but the remaining 10% arrive within 120 days. Which window should be used for official metrics, and what should be reported earlier?
Show answer
Use a window based on the required completeness, such as 120 days for near-complete official metrics. Report earlier metrics with their label coverage and validate their error against mature historical cohorts.