Skip to content
ORBIT

Chapter 4 of 6

Fit without spending the holdout

Freeze test ids before any preprocessor is fit. Tune inside train. Read validation once after the inner bar clears. A reproducible training run is not yet a promotable release.

Operating rule

My operating rule: write the test hash before any fit, clear the bar on an inner slice before validation is read, and never open a tuning loop on the same holdout that already failed.

Checked 29 Oct 2026ML pipeline field card

Freeze the split

Start from Prepare’s matured rows (window closed and outcome available) and label_delay_days in quality.json. Sort by decision time. Last tenth → test; previous tenth → validation; rest → train. Apply the same embargo of label_delay_days at train|validation and at validation|test; gap rows enter neither adjacent set. Keep entity keys disjoint across partitions. Persist ids and hash test ids into split_ids.parquet before any preprocessor is fit.

Time order is the default when the decision has a clock. Without decision time, use a stratified random split with a fixed seed — the weaker case — and still require matured rows and disjoint entities. scikit-learn’s held-out practice applies; selecting again on the same frozen ids spends the holdout.14

1Matured onlyFrom quality.json2Sort by timeEarliest cut first3Cut the tenthsLast tenth is test4Embargo twicelabel_delay_days5Entities apartOne invoice, one set6Hash test idssplit_ids.parquetAll six happen before any preprocessor is fit.earlier cutslater cutsTrainEvery transform and the model are fitted here, and only here.ValidationScored once, afterselection.TestFrozen ids. Loadedonce, in Ship.embargolabel_delay_daysembargolabel_delay_daysWidths show roles, not measured shares.ENTITY SEPARATIONINV-A stays in trainits later copy is dropped from evaluationsplit_ids.parquettest hash written · training code loads train and validation onlyPASSEvery row matured. Entity sets disjoint. max(train) + embargo ≤ min(validation), and the same at validation | test. Test hash stored.
1Matured onlyFrom quality.json2Sort by timeEarliest cut first3Cut the tenthsLast tenth is test4Embargo twicelabel_delay_days5Entities apartOne invoice, one set6Hash test idssplit_ids.parquetAll six happen before any preprocessor is fit.↓ later cutsTrainEvery transform and the model are fitted here, andonly here.embargo · label_delay_daysValidationScored once, after selection.embargo · label_delay_daysTestFrozen ids. Loaded once, in Ship.Heights show roles, not shares.ENTITY SEPARATIONINV-A stays in train.Its later copy is dropped from evaluation.split_ids.parquetTest hash written. Training code loads train andvalidation only.Pass: Every row matured. Entity sets disjoint. max(train)+ embargo ≤ min(validation), and the same at validation |test. Test hash stored.
Figure 1. The freeze Fit owns: matured rows only, time order, two embargoes, entities apart, test ids hashed. Widths are illustrative.
Trainfitted onValidationread onceTest idssealed until stage 7oldernewer
Figure 2. The split in the same order: train, embargo, validation read once, embargo, test ids sealed until stage 7.

Prepare the table

Train inside the freeze

Fit every preprocessor on train only — imputation, missing indicators, rare-level map, cap bounds, scaler, target-encoding map — then apply without refitting. Save preprocess.joblib with the model.

Inner slice = last tenth of train. Score the baseline there. On this illustration the baseline is oldest past-due first. Metric is named in task.json (average precision when positives are rare, else ROC-AUC; Brier when the served value is a probability). Ranking quality under the historical contact policy is the gate — not a causal estimate of placing a call.

Train a regularized linear model and a tree model. Prune and tune on the inner slice only. Validation stays unread while candidates are selected. After Loops A and B finish on the inner slice, score validation once for the single remaining candidate; choose any hard threshold on that same read and freeze it for Ship. Write model.joblib and val_metrics.json with val_reads = 1.

TRAIN PARTITIONpreprocess.joblib is fitted on these rowsFIT ROWSThe first nine tenthsof train. Candidateslearn here.CANDIDATE SELECTION1Fit linear and tree2Prune importance ≤ 03Tune: Loops A and BINNER SLICELast tenth of train.Scores everycandidate and thebaseline.baseline: oldestpast-due first↻ revise until one clears, or the budgets run outonecandidateVALIDATION · READ ONCEval_reads = 1Any hard threshold is chosen onthis read and frozen.passSELECTEDmodel.joblibval_metrics.jsonfailblockednever between iterationsTest · frozen, not loadedSelection happens inside train.Validation answers once, for the single candidate that cleared the inner bar.Inner slice and validation are both the last tenth of their range in this recipe; the widths here are not to scale.
TRAIN PARTITIONFIT ROWSFirst nine tenths. Candidates learn here.CANDIDATE SELECTION1Fit linear and tree2Prune importance ≤ 03Tune: Loops A and B↻ reviseINNER SLICE · LAST TENTH OF TRAINScores every candidate and the oldest-firstbaseline.Loops until one clears or budgets run out.preprocess.joblib fitted on these rowsone candidateVALIDATION · READ ONCEval_reads = 1Any hard threshold is chosen here and frozen.passfailSELECTED CANDIDATEmodel.joblibval_metrics.jsonblockedTest · frozen, not loadedRed dashed: validation never feeds back into selection.Not to scale.
Figure 3. Selection on the inner slice. Validation is scored once afterward — not between revisions.

When train misses the bar

The bar is min_metric and beating the baseline. Raw accuracy against a skewed paid base rate is not the bar. Loop budgets and the 0.005 improvement line are this recipe’s operating rule — finite returns, not a published standard.

Loop A and Loop B stay on the inner slice. Loop A: retune, max twenty trials; stop early after five trials that fail to improve by 0.005. Loop B: one feature_spec change per pass from inner errors, max three; then Loop A with ten trials — still no validation score between revisions. Only after A and B finish does the one official validation read run for the single inner-cleared candidate. A fail on that read sets model_card status blocked; it does not reopen A/B on the same validation ids — that would be an informal repeated selection loop.

Loop C: named data defect only (not a weak score alone); new split; discard old test ids unread; val_reads resets. One Fit run on the new freeze. Still short → blocked. Do not read test. Do not serve.

Forbidden: re-select on the same validation idsafter a validation readALoop A · TuneInner slice onlyMax 20 trialsStop after 5 trials with gain < 0.005shortBLoop B · FeaturesInner slice onlyOne spec change per pass, max 3Then 10 trials of AinnerclearedVALIDATIONRead onceval_reads = 1one candidatepassSHIPTest onceResiduals never returnto tuning.short, with anamed defectCLoop C · Data · onceA named data defect, not a weak scoreRepair in Quality or OutliersNew split; old test ids discarded unreadval_reads resetsnew freeze,onceblockedTest is never read. Nothing is served.failshort, no defectfailsBudgets and the 0.005 line are this recipe’s operating rule, not a published standard.
Forbidden: re-select on the same validation idsALoop A · TuneInner slice onlyMax 20 trialsStop after 5 trials with gain < 0.005shortBLoop B · FeaturesInner slice onlyOne spec change per pass, max 3Then 10 trials of AAFTER A AND BInner cleared → validationShort, named defect → Loop CShort, no defect → blockedVALIDATION · READ ONCEval_reads = 1fail → blockedpassSHIP · TEST ONCEResiduals never return to tuning.CLoop C · Data · onceA named data defect, not a weak scoreRepair in Quality or OutliersNew split; old test ids discarded unreadval_reads resetsReturns to A once, on a new freeze. Still short →blocked.Budgets and the 0.005 line are this recipe’s operating rule.
Figure 4. Miss loops on the inner slice. One validation read after A and B — not between them.

Clearing validation once makes a reproducible candidate. It does not promote a release. Ship still owns the one test read, the bundle, and the previous version.

When a draft is cheap

A generated AutoML run can report a strong score after peeking at later mornings. Fit without spending the holdout still applies. The freeze is the check, not the leaderboard.

References

  1. scikit-learn, cross-validation
  2. Features that hold
  3. Prepare the table
  4. ML pipeline agent recipe