bootstrap_convergence_trace

bootstrap_convergence_trace(
    make_model,
    X,
    y,
    n_boot=100,
    percentiles=(10, 50, 90),
    seed=42,
)

Running bootstrap stability of a model’s predictions, for a convergence plot.

Refits make_model() to n_boot bootstrap resamples of (X, y) and predicts at the given percentiles of the inputs. After each resample it records the average and largest prediction spread so far, measured with relative_spread (as the Bootstrap Convergence diagnostic does).

Parameters

Name Type Description Default
make_model Callable[[], estimator] Returns a fresh, unfitted model. required
X np.ndarray Training inputs. required
y np.ndarray Training responses. required
n_boot int Number of bootstrap resamples. 100
percentiles Input percentiles used as probe points. (10, 50, 90)
seed int Seed for the resampling. 42

Returns

Name Type Description
dict Dict[str, np.ndarray] iterations, running_avg and running_max arrays.