metacausal.adapters.CausalEstimator

class metacausal.adapters.CausalEstimator(*args, **kwargs)[source]

Bases: Protocol

Protocol that all causal estimator adapters must satisfy.

Any object with a name property, supports_cate flag, the supported_outcome_types declaration, and fit/ate/cate /validate_outcome_type methods matching this signature can be used as a component in CausalEnsemble.

Outcome-type capability is declared via two members:

  • supported_outcome_types: a tuple of strings drawn from ("continuous", "binary") indicating which outcome types this adapter can handle. The ensemble filters the candidate pool against the detected outcome type using this declaration: components whose tuple lacks the detected type are dropped before fitting.

  • validate_outcome_type(detected): raises ValueError if the adapter’s configured nuisance learners are inconsistent with the detected outcome type — for example, a regressor wired into a slot that needs a classifier when Y is binary. For adapters with no user-configurable nuisance, a no-op is appropriate.

Methods

Attributes

Details

ate(X=None)[source]
Parameters:

X (ndarray | None)

Return type:

ComponentAteEstimate

cate(X)[source]
Parameters:

X (ndarray)

Return type:

ComponentCateEstimate

fit(X, T, Y, **kwargs)[source]
Parameters:
Return type:

None

validate_outcome_type(detected)[source]
Parameters:

detected (str)

Return type:

None

property name: str
supported_outcome_types: tuple[str, ...]
property supports_cate: bool