deephyper.ensemble.aggregator.MixedNormalAggregator

deephyper.ensemble.aggregator.MixedNormalAggregator#

class deephyper.ensemble.aggregator.MixedNormalAggregator(decomposed_scale: bool = False)[source]#

Bases: Aggregator

Aggregate a collection of predictions, each representing a normal distribution.

This aggregator combines the mean (loc) and standard deviation (scale) of multiple normal distributions into a single mixture distribution.

Eventhough the mixture of normal distributions is not a normal distribution, this aggregator approximates it as a normal and only returns the mean and standard deviation of the mixture.

Array (Fixed Set)

MaskedArray

Parameters:

decomposed_scale (bool, optional) – If True, the scale of the mixture distribution is decomposed into aleatoric and epistemic components. Default is False.

Methods

aggregate

Aggregate the predictions.

aggregate(y: List[Dict[str, ndarray]], weights: List[float] | None = None) Dict[str, ndarray][source]#

Aggregate the predictions.

Parameters:
  • y (List[Dict[str, np.ndarray]]) – Predictions with keys: - loc: Mean of each normal distribution, shape (n_predictors, n_samples, ..., n_outputs). - scale: Standard deviation of each normal distribution.

  • weights (Optional[List[float]]) – Predictor weights. Defaults to uniform weights.

Returns:

Aggregated predictions with:
  • loc: Mean of the mixture distribution.

  • scale: Standard deviation (or decomposed components if decomposed_scale is

    True).

Return type:

Dict[str, np.ndarray]