def calcMean(self, X, w, training = False):
        self.count += 1
        if self.verbose and self.count <= (self.max_evals * len(self.param_space)) and not self.count%10 and training:
            self.pbar.update(self.count)
        
        if self.mean == 'simple':
            return np.sum(X, axis=1)/X.shape[1]
        else:
            w = [w[k] for k in sorted(self.sorting, key=self.sorting.get)]
            if self.mean == 'arithmetic':
                return np.sum(X * w, axis=1)/np.sum(w)
            elif self.mean == 'geometric':
                return np.exp(np.sum(np.log(X) * w, axis=1)/np.sum(w))
            elif self.mean == 'power':
                return 1/(1+np.exp(-np.sum(X ** w, axis=1)))
            else:
                print 'Mean should be either "simple", "arithmetic", "geometric" or "power"'
Calculate Mean according to weights.
dataset/ETHPy150Open alexandrebarachant/Grasp-and-lift-EEG-challenge/ensembling/WeightedMean.py/WeightedMeanClassifier.calcMean