Bases: Aggregate_Base
  
      Aggregate function based on averaging via median.
This class should be passed to an ensemble function/class for combining predictions.
        
          Source code in aucmedi/ensemble/aggregate/averaging_median.py
          | 30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 | class AveragingMedian(Aggregate_Base):
    """ Aggregate function based on averaging via median.
    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 median
        pred = np.median(preds, axis=0)
        # Return merged prediction
        return pred
 |