cleverly.validation.PlannedRefits#
- class cleverly.validation.PlannedRefits(tests: tuple[PlannedRefitTest, ...], estimand: str, random_state: int | None, notes: tuple[str, ...] = ())[source]#
The refits and learner fits a
refute()call would make, counted before any fit.cleverly.validation.planned_refits()returns one.- Parameters:
- Attributes:
total_refitsintThe refits over every test.
total_learner_fitsintThe top-level learner fits over every test, an upper bound when not
exact.total_candidate_fitsintThe base-estimator fits over every test.
min_fitsintThe fewest top-level fits over every test when no draw fails.
exactboolWhether every test is exact.
Methods#
- PlannedRefits.summary(*, detail: Literal['short', 'full'] = 'short') Summary[source]#
Return the printed table of the planned refits.
- Parameters:
- detail{“short”, “full”},
default“short” "full"adds each test’s notes and the record’s notes.
- detail{“short”, “full”},
- Returns:
SummaryA
strwhose text is the printed table; a notebook renders it as HTML.
- PlannedRefits.to_frame(backend: str | None = None) Any[source]#
Return one row per test.
- Parameters:
- backend{“pandas”, “polars”, “pyarrow”}
orNone, default=None Dataframe backend to return.
Noneuses pandas when installed, then the first available backend.
- backend{“pandas”, “polars”, “pyarrow”}
- Returns:
dataframeColumns
test,draws,refits_per_draw,refits,learner_fits,candidate_fits,min_fits,preparation,storedandbound.
Attributes#
- PlannedRefits.exact#
Whether every test is exact.
- PlannedRefits.min_fits#
The fewest top-level fits over every test when no draw fails.
- PlannedRefits.total_candidate_fits#
The base-estimator fits over every test.
- PlannedRefits.total_learner_fits#
The top-level learner fits over every test, an upper bound when not
exact.
- PlannedRefits.total_refits#
The refits over every test.
- PlannedRefits.tests: tuple[PlannedRefitTest, ...]#