Skip to content

Averaging mean

AveragingMean ยค

Bases: Aggregate_Base

Aggregate function based on averaging via mean.

This class should be passed to an ensemble function/class for combining predictions.

Source code in aucmedi/ensemble/aggregate/averaging_mean.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class AveragingMean(Aggregate_Base):
    """ Aggregate function based on averaging via mean.

    This class should be passed to an ensemble function/class for combining predictions.
    """
    #---------------------------------------------#
    #                Initialization               #
    #---------------------------------------------#
    def __init__(self):
        # No hyperparameter adjustment required for this method, therefore skip
        pass

    #---------------------------------------------#
    #                  Aggregate                  #
    #---------------------------------------------#
    def aggregate(self, preds):
        # Merge predictions via mean
        pred = np.mean(preds, axis=0)
        # Return merged prediction
        return pred