code: def predict(self, X, cost_mat=None):
          if self.n_features_ != X.shape[1]:
              raise ValueError("Number of features of the model must "
                               "match the input. Model n_features is {0} and "
                               "input n_features is {1}."
                               "".format(self.n_features_, X.shape[1]))
          if self.combination in ['stacking', 'stacking_proba']:
              X_stacking = _create_stacking_set(self.estimators_, self.estimators_features_,
                                                self.estimators_weight_, X, self.combination)
              return self.f_staking.predict(X_stacking)
          elif self.combination in ['majority_voting', 'weighted_voting']:
              n_jobs, n_estimators, starts = _partition_estimators(self.n_estimators,
                                                                   self.n_jobs)
              all_pred = Parallel(n_jobs=n_jobs, verbose=self.verbose)(
                  delayed(_parallel_predict)(
                      self.estimators_[starts[i]:starts[i + 1]],
                      self.estimators_features_[starts[i]:starts[i + 1]],
                      X,
                      self.n_classes_,
                      self.combination,
                      self.estimators_weight_[starts[i]:starts[i + 1]])
                  for i in range(n_jobs))
              pred = sum(all_pred) / self.n_estimators
              return self.classes_.take(np.argmax(pred, axis=1), axis=0)
          elif self.combination in ['majority_bmr', 'weighted_bmr', 'stacking_bmr', 'stacking_proba_bmr']:
              X_bmr = self.predict_proba(X)
              return self.f_bmr.predict(X_bmr, cost_mat)