cleverly.validation.RefutationResult#

class cleverly.validation.RefutationResult(tests: tuple[RefutationTest, ...], estimand: str, backend: str | None = None, random_state: int | None = None)[source]#

All refutation tests run on a fit.

Parameters:
teststuple of RefutationTest

One record per refutation run.

estimandstr

Alias the tests were run for.

backendstr or None

Dataframe backend to_frame() returns when data is omitted.

random_stateint or None

Seed this report ran under. Pass it back to refute() to obtain the report again, whether or not the fit carries a seed of its own. None only on a report built by hand.

Methods#

RefutationResult.draws_frame(name: str, data: Any = None) → Any[source]#

Return successful and failed draws for one empirical refit test.

Parameters:
namestr

Name of a generated-outcome or measurement-error refutation in this report.

dataAny

Dataframe or fitted container whose backend to match. None uses the backend recorded by the report.

Returns:
dataframe

One row per requested empirical draw.

RefutationResult.summary() → str[source]#

Return a printable summary.

Returns:
str

A printable table, one line per refutation test.

RefutationResult.to_frame(data: Any = None) → Any[source]#

Return tabular output in the input dataframe backend.

Parameters:
dataAny

A dataframe or fitted container whose backend to match. None uses the backend recorded on this object.

Returns:
dataframe

One row per refutation test.

Attributes#

RefutationResult.backend: str | None = None#

Name of the dataframe backend the fit’s data arrived in, so that to_frame() honours “results come back in the backend you passed in” without a caller having to thread the container back in by hand.

RefutationResult.passed#

Return whether every required check passed.

RefutationResult.random_state: int | None = None#

Seed this report ran under, resolved rather than requested: an explicit seed, else the fit’s own, else one drawn here. It pins the perturbations and the refits they feed, so the report is enough to obtain the report again.

RefutationResult.tests: tuple[RefutationTest, ...]#
RefutationResult.estimand: str#