metacausal.CateEstimate

class metacausal.CateEstimate(cate, component_estimates, aggregation, ensemble_weights=None)[source]

Bases: object

Ensemble CATE result. Pure data, no model references.

Variables:
Parameters:

Methods

__init__

cate_profile

Ensemble CATE along one covariate (no CI band; use cate_profile() for a bootstrap band).

summary

Return a formatted, multi-line CATE summary.

Attributes

component_cates

CATE arrays from each component method.

ensemble_weights

n_methods

Number of methods that produced CATE estimates.

cate

component_estimates

aggregation

Details

cate_profile(x, *, xlabel, ax=None, show_components=True, ylim=None, ensemble_label='Ensemble CATE')[source]

Ensemble CATE along one covariate (no CI band; use cate_profile() for a bootstrap band).

Thin wrapper around metacausal.plots.cate_profile(); see there for the full parameter reference. Requires the plots extra (pip install 'metacausal[plots]').

Returns:

matplotlib Axes the plot was drawn on.

Parameters:
Return type:

Axes

summary(*, digits=None, signed=False)[source]

Return a formatted, multi-line CATE summary.

Parameters:
  • digits (int | None)

  • signed (bool)

Return type:

str

aggregation: str
cate: ndarray
property component_cates: dict[str, ndarray]

CATE arrays from each component method.

component_estimates: dict[str, ComponentCateEstimate]
ensemble_weights: EnsembleWeights | None = None
property n_methods: int

Number of methods that produced CATE estimates.