Practice in Lab: Project: train uncertainty and calibrate independent prediction intervals →
Project: train uncertainty and calibrate independent prediction intervals
An uncertainty model and an interval calibration procedure answer different questions. This project trains a heteroscedastic likelihood, selects its checkpoint on validation data, and only then uses a separate calibration partition to choose interval width. The corrected order statistic is an integer rank, not an interpolated percentile. Final test rows measure observed coverage without feeding back into model or quantile selection. Synthetic regions make subgroup differences visible while keeping every row reproducible offline.
Prepare offline
Choose Download entire course or Download entire category first. After completion, code and checks run locally on CPU. The independent example needs no account, remote service or API key.
import math
n = 128
alpha = .1
print(math.ceil((n+1)*(1-alpha)))Review the evidence
Explain the exchangeability assumption and the distinction between marginal, conditional and subgroup coverage. Refit on shifted data only with a new evaluation protocol; a single observed coverage number is not a universal guarantee.
Your task
Build the complete local synthetic heteroscedastic regression experiment with four disjoint partitions: training, validation selection, conformal calibration and final test. Train both mean and positive variance using Gaussian NLL, choose the checkpoint by validation NLL, then compute normalized absolute calibration residuals and the finite-sample ceil((n+1)*(1-alpha)) order statistic without interpolation. Export the learned state plus quantile, reload in a fresh model, and report actual test coverage, width and left/right-region coverage. Calibration and test labels must never fit or select model weights. Keep the full reference report schema. Marginal conformal coverage requires exchangeability and does not imply subgroup coverage.
The explanation opens here once every check passes.