cleverly.VariableImportanceResult#

class cleverly.VariableImportanceResult(entries: tuple[VariableImportanceEntry, ...], fits: Mapping[str, TMLEResult], method: str = 'Benjamini-Hochberg', backend: str | None = None)[source]#

Candidate-exposure estimates with multiplicity-adjusted null tests.

Parameters:
entriestuple of VariableImportanceEntry

One entry per candidate and parameter.

fitsmapping of str to TMLEResult

The fit behind each candidate.

methodstr

Multiplicity adjustment applied to the p-values.

backendstr or None

Dataframe backend to_frame() returns.

Methods#

VariableImportanceResult.to_frame() → Any[source]#

One row per candidate/parameter, in the order of the entries.

A run sorts its entries by adjusted p-value. An ordinary result emits std_err, ci_lower, ci_upper, p_value and p_value_adjusted. A result at a labelled status adds an inference column that names the status. A result whose entries supply no inference emits an inference column and the three spread columns under their diagnostic names, as TMLEResult.to_frame does. It emits neither p-value column. Every fit of one run shares one estimator and one set of rows, so the entries share one status.

Returns:
dataframe

One row per candidate and parameter, in the order of the entries.

Raises:
ValueError

When the entries declare different inference statuses.

Attributes#

VariableImportanceResult.backend: str | None = None#
VariableImportanceResult.method: str = 'Benjamini-Hochberg'#
VariableImportanceResult.entries: tuple[VariableImportanceEntry, ...]#
VariableImportanceResult.fits: Mapping[str, TMLEResult]#