metacausal.aggregation.Mean¶
- class metacausal.aggregation.Mean[source]¶
Bases:
PointwiseStrategyPointwise mean aggregation.
Examples
Same four component predictions as
Median’s example; here the outlier (90.0) drags the mean well above the other three models’ ~11:>>> import numpy as np >>> from metacausal.aggregation import Mean >>> values = np.array([[10.0, 5.0], [11.0, 5.0], [12.0, 5.0], [90.0, 5.0]]) >>> Mean().aggregate(values) array([30.75, 5. ])
Methods
__init__Reduce a
(K, n)component-CATE matrix to a(n,)ensemble CATE.Attributes
ensemble_weightsEnsemble weights, if applicable.
strategy_familyDetails
- aggregate(values)[source]¶
Reduce a
(K, n)component-CATE matrix to a(n,)ensemble CATE.Kis the number of component models;nis the number of evaluation points. Subclasses define the per-family rule (pointwise statistical reduction, weighted combination, learned linear combination, etc.).PointwiseStrategyextends 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.