cleverly.validation.StudyResult#

class cleverly.validation.StudyResult(summaries: dict[str, EstimandSummary], replications: tuple[ReplicationRecord, ...], failures: tuple[ReplicationFailure, ...], n: int, n_replicates: int, alpha: float, label: str)[source]#

The full output of a CoverageStudy.

Parameters:
summariesdict of str to EstimandSummary

Bias, coverage and rejection rate per estimand.

replicationstuple of ReplicationRecord

One record per estimand per successful draw.

failurestuple of ReplicationFailure

One record per draw that raised.

nint

Sample size per replication.

n_replicatesint

Replications requested.

alphafloat

Significance level coverage was measured at.

labelstr

Name of the study, for reports.

Methods#

StudyResult.summary() → str[source]#

Return a printable summary.

Returns:
str

A printable table, one line per estimand.

StudyResult.to_frame(backend: str | None = None) → Any[source]#

Return tabular output in the input dataframe backend.

Parameters:
backend{“pandas”, “polars”, “pyarrow”} or None, default=None

Dataframe backend to return. None uses pandas when installed, then the first available backend.

Returns:
dataframe

One row per estimand, with bias and coverage.

StudyResult.verdict() → str[source]#

Reading of the study, naming the specific failure mode where there is one.

Returns:
str

A reading of the study, naming the failure mode where there is one.

Attributes#

StudyResult.n_failed#

Return the number of failed replications.

StudyResult.summaries: dict[str, EstimandSummary]#
StudyResult.replications: tuple[ReplicationRecord, ...]#
StudyResult.failures: tuple[ReplicationFailure, ...]#
StudyResult.n: int#
StudyResult.n_replicates: int#
StudyResult.alpha: float#
StudyResult.label: str#