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:
- summaries
dictofstrtoEstimandSummary Bias, coverage and rejection rate per estimand.
- replications
tupleofReplicationRecord One record per estimand per successful draw.
- failures
tupleofReplicationFailure One record per draw that raised.
- n
int Sample size per replication.
- n_replicates
int Replications requested.
- alpha
float Significance level coverage was measured at.
- label
str Name of the study, for reports.
- summaries
Methods#
- StudyResult.summary() str[source]#
Return a printable summary.
- Returns:
strA 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”}
orNone, default=None Dataframe backend to return.
Noneuses pandas when installed, then the first available backend.
- backend{“pandas”, “polars”, “pyarrow”}
- Returns:
dataframeOne row per estimand, with bias and coverage.
Attributes#
- StudyResult.n_failed#
Return the number of failed replications.
- StudyResult.replications: tuple[ReplicationRecord, ...]#
- StudyResult.failures: tuple[ReplicationFailure, ...]#