compile_selected
from compileml import compile_selected
Compile the whitebox whose target and configuration were chosen on Select.
Args:
X, y: All rows and binary outcomes; the function partitions them.
ceiling: A callable (X_fit, y_fit) -> fitted model. It is called
once, its configuration is frozen, and that configuration is
refit k_folds times for cross-fitted soft targets. One search
plus K fits — never K searches.
ceiling_oof, ceiling_scores: For users who can only supply
predictions: out-of-fold predictions used as soft targets, and
the ceiling's scores used for retention, both full-length.
Provenance then records cross_fitted: "user_asserted".
ceiling_budget: Free-form dict recorded in provenance — trials, CV
scheme, search space — so retention is comparable across artifacts.
reference: "woe" fits the WoE logistic floor inside Fit; a float
is a champion scorecard's Gini; None skips the floor gate,
with a warning.
partitions: "stratified", or an explicit dict of index arrays.
date, group, row_id: Arrays (or column names, when X has columns).
date makes Report the latest slice; group keeps one
applicant in one partition; row_id turns partition overlap
into a hard failure.
grid: See :func:`default_grid`.
selection_metric: "gini" (default) or "brier".
tie_se: Width of the tie band in standard errors.
min_select_events: Below this many events in Select, selection uses
nested cross-validation over Fit ∪ Select instead, with a warning.
allow_below_floor: Build the artifact even if the selected
configuration does not beat the floor on Select.
eps_warn: Provisional events-per-split threshold below which the
grid should hold interior α values; a diagnostic, never an input.
duplicate_threshold: Maximum share of Select and Report rows whose
content also appears in an earlier partition.
backend: "hist" (the fast histogram backend) or "gbr".
Returns:
A :class:`SelectionResult`. Call .report() once for the figure.
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| X | — | required | positional |
| y | — | required | positional |
| ceiling | — | None | keyword-only |
| ceiling_oof | — | None | keyword-only |
| ceiling_scores | — | None | keyword-only |
| ceiling_budget | dict | None | None | keyword-only |
| reference | — | 'woe' | keyword-only |
| partitions | — | 'stratified' | keyword-only |
| date | — | None | keyword-only |
| group | — | None | keyword-only |
| row_id | — | None | keyword-only |
| grid | dict | None | None | keyword-only |
| monotone_constraints | — | None | keyword-only |
| selection_metric | str | 'gini' | keyword-only |
| tie_se | float | 1.0 | keyword-only |
| n_boot | int | 200 | keyword-only |
| k_folds | int | 5 | keyword-only |
| min_select_events | int | 300 | keyword-only |
| n_bands | int | 10 | keyword-only |
| feature_names | — | None | keyword-only |
| reasons | dict | None | None | keyword-only |
| sample_weight | — | None | keyword-only |
| allow_below_floor | bool | False | keyword-only |
| eps_warn | float | 10.0 | keyword-only |
| duplicate_threshold | float | 0.01 | keyword-only |
| backend | str | 'hist' | keyword-only |
| learning_rate | float | 0.2 | keyword-only |
| seed | int | 42 | keyword-only |
| build_kwargs | dict | None | None | keyword-only |
Returns#
compileml.select.SelectionResult
Raises#
- ValueError
Read from the function body and the private helpers it calls, not inferred. A function that raises nothing has no section here.