deephyper.ensemble.aggregator.MixedCategoricalAggregator

deephyper.ensemble.aggregator.MixedCategoricalAggregator#

class deephyper.ensemble.aggregator.MixedCategoricalAggregator(uncertainty_method='confidence', decomposed_uncertainty: bool = False)[source]#

Bases: Aggregator

Aggregate a set of categorical distributions.

Array (Fixed Set)

MaskedArray

Parameters:
  • uncertainty_method (str, optional) –

    Method to compute the uncertainty. Can be either "confidence" or "entropy". Default is "confidence".

    • "confidence": The uncertainty is computed as 1 - max(probability) of the aggregated categorical distribution of ensemble.

    • "entropy": The uncertainty is computed as the entropy of of the aggregated categorical distribution of ensemble.

  • decomposed_uncertainty (bool, optional) – If True, the uncertainty of the ensemble is decomposed into aleatoric and epistemic components. Default is False.

Methods

aggregate

Aggregate the predictions using the mode of categorical distribution.

aggregate(y: List, weights: List = None)[source]#

Aggregate the predictions using the mode of categorical distribution.

Parameters:
  • y (np.array) – Predictions array of shape (n_predictors, n_samples, n_outputs).

  • weights (list, optional) – Weights of the predictors. Default is None.

Returns:

Aggregated predictions of shape (n_samples, n_outputs).

Return type:

np.array