Why Validate on Later Records?
A model can perform well on its development data and at another clinical site yet still require evaluation on records collected later. The patient mix, measurement practices, treatment patterns, and data systems may change with calendar time. Temporal validation asks whether a fixed model produces acceptably useful predictions when applied to a later period in the intended clinical setting.
This is a validation exercise, not a model update. The model version, input transformations, and prediction procedure are held fixed; later records are used to evaluate performance, not to fit or tune the model. If those records are used to select a new model or revise its parameters, a separate later dataset is needed for an unbiased evaluation of that revised version.
The target must be explicit. For example, a validation might assess predictions of a drug concentration at a specified sampling time among patients receiving a particular dosing regimen. It should state who is eligible, when each prediction is made, what outcome is compared with that prediction, and which records fall within the validation period. The evaluation is only meaningful if these definitions match the intended use.
Set Up a Valid Temporal Evaluation
Begin with the model’s development cutoff date and specify the later validation period before examining its results. Define a prediction occasion as well as a patient: one patient may contribute several occasions, such as multiple concentration predictions during treatment. When records are repeated, the analysis must account for that dependence rather than treating every occasion as an unrelated patient.
For each eligible occasion \(i\), let \(y_i\) be the observed outcome and \(\hat{y}_i\) the prediction made by the locked model. The prediction must be reproducible from information available at the stated prediction time. For example, a laboratory result collected after the prediction time cannot be used as an input, even if it appears in the same clinical record. Outcome definitions, assay units, sampling windows, and eligibility rules should be applied consistently across development and validation periods.
Specify the intended population, prediction time, outcome, model version, and validation dates before calculating performance.
Apply eligibility and data-timing rules to records after the development cutoff. Keep a count of eligible records, usable predictions, and observed outcomes.
Calculate prespecified measures on the records with valid predictions and outcomes, and report how many records were excluded or lacked required information.
Interpret results against clinically justified thresholds set before review, including any period-specific requirements.
The observed outcome also needs careful interpretation. If clinicians acted on model recommendations during the validation period, the resulting records reflect care under that practice. Comparing predictions with those observed outcomes evaluates predictive performance in the care actually delivered; it does not establish what would have happened under a different dose or prove that using the model improved outcomes. Estimating the causal effect of a recommendation requires a design suited to that question.
Prediction Performance in Clinical Units
For a continuous outcome, a simple measure is the absolute prediction error, \(|\hat{y}_i-y_i|\). The mean absolute error (MAE) is the average of these errors, in the same units as the outcome. The root mean squared error (RMSE) gives greater influence to large errors because it squares each error before averaging. Neither measure alone establishes clinical usefulness: acceptance limits should reflect the outcome and consequences of error.
Here \(n\) is the number of evaluable prediction occasions. An error of 1 mg/L has a different interpretation from an error of 1 hour, so always report units and the outcome context. If an analysis uses multiple occasions per patient, state that fact and use an uncertainty method that respects patient-level clustering, such as resampling patients rather than individual occasions. A nominal sample size counting every occasion as independent can make uncertainty appear smaller than it is.
Worked Example: Calculating Error on Later Concentration Records
Suppose a hypothetical locked model is evaluated on five eligible, later prediction occasions. The observed concentrations are 8, 10, 12, 9, and 11 mg/L, while the corresponding predictions are 9, 9, 15, 8, and 10 mg/L. Assume each prediction was generated from information available before its corresponding concentration was measured, and all five outcomes use the same assay and units.
The prediction errors \(\hat{y}_i-y_i\) are \(1,-1,3,-1,-1\) mg/L. Their absolute values are \(1,1,3,1,1\) mg/L. Therefore:
The squared errors are \(1,1,9,1,1\) \((\mathrm{mg/L})^2\), so:
The RMSE exceeds the MAE because the 3 mg/L error contributes relatively strongly after squaring. These values describe this five-occasion evaluation set; by themselves they do not show that the model meets a clinical standard. That judgment requires an acceptance criterion specified for the intended use and an assessment of the uncertainty and representativeness of the evaluation records.
Check Whether the Data Are Still Available
A deployed model cannot be evaluated in practice if its required inputs are absent, delayed, or recorded in incompatible forms. Temporal validation should therefore report data availability alongside prediction performance. Useful denominators include the number of eligible occasions, the number with all required inputs available at prediction time, and the number with an assessable outcome. Distinguish missing inputs from missing outcomes: they prevent different stages of evaluation.
A complete-case performance estimate can be misleading if records with complete inputs or measured outcomes differ systematically from the eligible population. Report counts at each stage and compare included and excluded records on relevant observed characteristics where possible. Also check whether the later period introduced new units, coding conventions, or measurement windows. A record is not truly available for model use if its value only becomes known after the intended prediction time.
Worked Example: Quantifying Input and Outcome Availability
In a hypothetical six-month validation period, 200 occasions meet the clinical eligibility rules. A required weight is recorded in 188 occasions, required creatinine is available in 180, and dose history is available in 170. After applying the model’s actual input requirements, 164 occasions have all required inputs available at prediction time. Valid outcomes are obtained for 150 of those 164 occasions.
The fraction of eligible occasions with usable model inputs is:
The outcome availability among occasions with usable inputs is:
Only 150 of the 200 eligible occasions contribute to the performance calculation, so the overall fraction with both usable inputs and an observed outcome is \(150/200=75.0\%\). If the prespecified requirement is that at least 90% of eligible occasions support a complete evaluation, this validation fails that availability criterion, even if the error metric among the 150 evaluable occasions is acceptable. The separate percentages identify where records were lost and prevent outcome availability from being mistaken for overall evaluability.
Compare Time Periods Without Hiding Weakness
A single metric over the whole later period can conceal an important difference between earlier and later portions of that period. Report results in prespecified windows when there is a clinical or operational reason to expect conditions to change, such as calendar quarters or periods before and after a known laboratory-system transition. These comparisons are descriptive checks within temporal validation; they are not, on their own, proof of why performance differs.
For disjoint windows with \(n_j\) evaluated occasions and window-specific MAE \(\mathrm{MAE}_j\), the overall MAE is the sample-size-weighted average of the window MAEs:
This identity follows by splitting the total sum of absolute errors into its window-specific sums. In window \(j\), that sum equals \(n_j\mathrm{MAE}_j\); adding those sums and dividing by the total number of occasions gives the overall expression. A pooled result can therefore be dominated by a larger window and should not replace period-specific results when each period must meet a clinical standard.
Worked Example: A Pooled Metric Can Mask a Period Failure
Suppose a hypothetical evaluation has 40 occasions in an earlier validation window with MAE 1.20 mg/L, and 60 occasions in a later window with MAE 2.00 mg/L. The prespecified maximum acceptable MAE is 1.80 mg/L overall, and each window must also meet that limit.
The pooled MAE is:
The pooled result meets the 1.80 mg/L limit, but the later window’s MAE of 2.00 mg/L exceeds it. Because the criterion applies to each window, the model does not meet the stated acceptance requirements. Reporting only 1.68 mg/L would hide the later-period failure. This comparison identifies a result requiring further investigation; it does not by itself identify the cause of the difference.
Assumptions, Comparisons, and Common Pitfalls
Interpretation depends on several conditions. The evaluated model must be the same locked version throughout; predictions and outcomes must refer to the same clinical target and compatible units; and eligibility and measurement rules must be applied consistently. Records must be correctly ordered in time, so that inputs precede predictions and predictions precede outcome measurement. Uncertainty estimates must also reflect the sampling structure, including repeated occasions within patients where relevant.
Temporal validation complements, rather than replaces, other evaluation approaches. A random split from one period can estimate performance on records resembling that period, but it does not directly test performance on later records. External validation evaluates a different clinical site or setting; temporal validation focuses on later records and may be performed within the same site. Prospective shadow evaluation can test a live workflow while recommendations are not used to direct care, but it is operationally different from retrospective evaluation of later clinical records. The choice depends on the question; none removes the need for clear cohort and outcome definitions.
A frequent mistake is to treat a good pooled error metric as proof that deployment remains acceptable. The incorrect reasoning is: “The overall MAE is below the threshold, so every later period is adequately served.” The correction is to compare prespecified period-specific results and data availability with the criteria that apply to each period, while reporting the pooled result as a summary. Another mistake is to calculate performance only among complete records and omit how many eligible records were excluded. That can make the model appear more usable than it is and can distort performance if excluded records differ from included ones.
Temporal validation has limits. A later cohort may be too small to estimate performance precisely, outcomes may be missing selectively, or clinical practice may have changed in ways that make the evaluation population different from intended future use. A pass against an acceptance threshold supports use only for the specified population, workflow, period, and outcome; it does not guarantee future performance or establish clinical benefit. A failure should prompt investigation, but this tutorial’s validation results alone do not diagnose its mechanism.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- Why must the model and its preprocessing be locked before temporal validation begins?
- A model has MAE 1.5 mg/L on 80% of eligible records, but the remaining 20% lack required inputs. What two distinct findings should be reported?
- In a temporal validation, clinicians acted on model recommendations. What can a comparison of predictions with observed outcomes establish, and what can it not establish by itself?
- Two disjoint periods have sample sizes 30 and 70, with MAEs 1.0 and 2.0 mg/L. Calculate the pooled MAE and explain why it may be insufficient.
- Why should repeated prediction occasions from one patient not automatically be treated as independent observations when estimating uncertainty?
Solutions. (1) Locking prevents the evaluation records from influencing model selection or fitting; otherwise the later records no longer provide an independent evaluation of that version. (2) Report the conditional performance among evaluable records, including its clinical units, and report that only 80% of eligible records had required inputs; the performance result does not establish adequate availability. (3) It assesses predictions against outcomes under care actually delivered. It cannot, without an appropriate causal design, establish what outcomes would have occurred under another dose or that the model improved outcomes. (4) The pooled MAE is \(\{30(1.0)+70(2.0)\}/100=1.70\) mg/L. It may be insufficient because the second period’s MAE is 2.0 mg/L and a pooled result can obscure a period-specific failure. (5) Occasions from one patient can share patient characteristics and clinical history, so their errors may be correlated. Treating them as independent can understate uncertainty; use an approach that accounts for patient-level clustering.