metacausal.aggregation.AggregationStrategy

class metacausal.aggregation.AggregationStrategy[source]

Bases: ABC

Abstract base class for all aggregation strategies.

Three concrete families inherit from this base — PointwiseStrategy, AgreementStrategy, SupervisedStrategy — and runtime dispatch in CausalEnsemble keys off the family base, since each family has a different fit-time and predict-time contract. All three families implement the same prediction-time operation: aggregate() reduces along axis 0.

Methods

__init__

aggregate

Reduce a (K, n) component-CATE matrix to a (n,) ensemble CATE.

Attributes

ensemble_weights

Ensemble weights, if applicable.

Details

abstractmethod aggregate(values)[source]

Reduce a (K, n) component-CATE matrix to a (n,) ensemble CATE.

K is the number of component models; n is the number of evaluation points. Subclasses define the per-family rule (pointwise statistical reduction, weighted combination, learned linear combination, etc.).

PointwiseStrategy extends this contract to also accept (K,) 1-D input (returning a 0-d scalar) for the component-ATE aggregation path; see its class docstring. Other families do not meaningfully support 1-D input.

Parameters:

values (ndarray)

Return type:

ndarray

abstract property ensemble_weights: EnsembleWeights | None

Ensemble weights, if applicable. None for pointwise strategies.