metacausal.aggregation.AgreementStrategy

class metacausal.aggregation.AgreementStrategy[source]

Bases: AggregationStrategy

Base class for strategies that select/weight models by inter-model agreement.

Weights are computed at fit time from training-data CATE predictions (no outcome data involved). Subclasses implement compute_weights().

ATE is computed as the mean of the ensemble CATE, not by aggregating scalar component ATEs. For bootstrap replicates, weights are recomputed from resampled training-data CATE predictions.

Methods

__init__

aggregate

Aggregate component CATEs using stored weights.

compute_weights

Compute weights from inter-model agreement on training predictions.

Attributes

ensemble_weights

Ensemble weights computed during fit().

strategy_family

Details

aggregate(values)[source]

Aggregate component CATEs using stored weights.

Parameters:

values (array of shape (K, n))

Returns:

Array of shape (n,).

Return type:

ndarray

abstractmethod compute_weights(cate_matrix, model_names)[source]

Compute weights from inter-model agreement on training predictions.

Called once during fit(), after component models are fitted on full training data. Subclasses implement this.

Parameters:
  • cate_matrix (array of shape (K, n)) – Training-data CATE predictions, one row per model.

  • model_names (list[str]) – Adapter names in the same order as rows of cate_matrix.

Returns:

EnsembleWeights populated with this strategy’s weights.

Return type:

EnsembleWeights

property ensemble_weights: EnsembleWeights | None

Ensemble weights computed during fit(). None before fit().

strategy_family: ClassVar[str] = 'agreement'