API reference¶
The top-level API measures instability for arbitrary fitted procedures and includes one representative-model selector plus fixed-design linear calibration tools. Inclusion means the implementation and workflow are supported; it does not imply a universal stabilization guarantee.
Bootstrap audits¶
Refit a model on bootstrap resamples and return every prediction it made. |
|
Measure how much a model's predictions move when the training data is perturbed. |
bootstrap_predictions returns every refitted prediction and the per-case
statistics. bootstrap_instability returns aggregate summaries and Monte
Carlo standard errors.
Model-selection frontier¶
Sweep a parameter grid and return the validation-score/instability tradeoff. |
|
Keep the configurations no other configuration beats on both axes. |
The score used to construct a frontier is a validation score. It is not a final test-set performance estimate.
Tree-structure audits¶
Return the multiset of features tested down to a given depth. |
|
Return the feature sequence each row is tested against on its way to a leaf. |
|
How much the structure changes across independently fitted trees. |
|
Fraction of fits that test the most common root feature. |
|
Fraction of rows routed through the same feature sequence by most fits. |
Read structural instability beside prediction instability. A consistently shallow or inaccurate tree can have perfectly stable structure.
Plots¶
Install plotting dependencies with pip install "stable-cart[plots]".
Draw the instability plot: original prediction against resampled predictions. |
|
Show instability as a function of predicted value: who the model is unsure about. |
|
Plot one or more model families on the validation-score/stability plane. |
Supported estimator and analytic tools¶
RepresentativeEstimator supports multiclass classification and selects a
single fitted candidate by validation-set prediction centrality. Its observed
stability benefit is task dependent. The linear functions are exact or
calibrated calculations under their documented fixed-design assumptions; they
are not general estimators.
Select one fitted estimator closest to a candidate-pool centroid. |
|
Analytic prediction instability of least squares, conditional on the design. |
|
Trace an oracle or plug-in frontier for fixed-design linear prediction. |
|
Coefficients of the estimator that achieves the frontier point at |