How do you use cross-validation to fit a probability calibrator without leakage?

Quick Overview

Explain how to use cross-validation to fit a Platt or isotonic calibrator on out-of-fold scores without leaking training data. Tests the two ways of assembling the calibrated model, honest evaluation, grouped splits and the choice of calibration method.

How do you use cross-validation to fit a probability calibrator without leakage?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How do you use cross-validation to fit a probability calibrator without leakage? ```hint Check every score the calibrator sees For each score the calibrator is fitted on, ask whether the model that produced it was trained on that same row. ``` ```hint Count the fitted pieces The model and the calibrator are both fitted, and then the pair is evaluated. Each step needs data that the earlier steps did not touch. ``` ### What a Strong Answer Covers - Why scores on the model's own training rows must not be used to fit the calibrator - How out-of-fold predictions provide honest calibration data - The two ways to assemble the final calibrated model (k model-calibrator pairs, or one calibrator plus a refit model) and their trade-offs - Keeping the final evaluation and any hyperparameter tuning outside the calibration loop - Choosing between sigmoid and isotonic given how much held-out data there is ### Follow-up Questions - The data has several rows per user. What changes in the cross-validation setup? - With `ensemble=False`, the calibrator is fit on fold models' scores but applied to a model refit on all the data. Is that a problem? - Where do preprocessing steps such as scaling or target encoding belong so they do not leak? - How would you confirm on the test set that calibration actually improved?

Overview: Explain how to use cross-validation to fit a Platt or isotonic calibrator on out-of-fold scores without leaking training data. Tests the two ways of assembling the calibrated model, honest evaluation, grouped splits and the choice of calibration method.

Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How do you use cross-validation to fit a probability calibrator without leakage?

What a Strong Answer Covers Guidance

  • Why scores on the model's own training rows must not be used to fit the calibrator
  • How out-of-fold predictions provide honest calibration data
  • The two ways to assemble the final calibrated model (k model-calibrator pairs, or one calibrator plus a refit model) and their trade-offs
  • Keeping the final evaluation and any hyperparameter tuning outside the calibration loop
  • Choosing between sigmoid and isotonic given how much held-out data there is

Follow-up Questions Guidance

  • The data has several rows per user. What changes in the cross-validation setup?
  • With ensemble=False , the calibrator is fit on fold models' scores but applied to a model refit on all the data. Is that a problem?
  • Where do preprocessing steps such as scaling or target encoding belong so they do not leak?
  • How would you confirm on the test set that calibration actually improved?