cleverly.interventions.SupportReport#

class cleverly.interventions.SupportReport(regimes: dict[str, ~cleverly.interventions.support.RegimeSupport] = <factory>, n: int = 0, backend: str | None = None)[source]#

RegimeSupport for every regime in a fit, plus the worst case.

The columns read two mechanisms. The smallest propensity, the largest ratio and the ratio effective sample size read the treatment mechanism before truncation, which is what the data support. The score load reads the fitted clever covariate of the targeting step, which divides by the truncated mechanism. summary() prints both facts under the table.

Parameters:
regimesdict of str to RegimeSupport

One record per regime, keyed by its report label.

nint

Number of observations the records were computed over.

backendstr or None

Dataframe backend to_frame() returns when data is omitted.

Methods#

SupportReport.summary() → str[source]#

A short human-readable table.

Returns:
str

A printable table, one line per row of the report.

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

One row per regime, in the backend the data came from.

Parameters:
dataAny

A dataframe or fitted container whose backend to match. None uses backend.

Returns:
dataframe

One row per regime.

Attributes#

SupportReport.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.

SupportReport.n: int = 0#
SupportReport.worst#

The regime with the smallest assigned-arm propensity.

SupportReport.regimes: dict[str, RegimeSupport]#