'Predict multi-class targets using underlying estimators.
Parameters
X : (sparse) array-like, shape = [n_samples, n_features]
Data.
Returns
y : (sparse) array-like, shape = [n_samples, ], [n_samples, n_classes].
Predicted multi-class targets.'

def predict(self, X):

    check_is_fitted(self, 'estimators_')
    if (hasattr(self.estimators_[0], 'decision_function') and is_classifier(self.estimators_[0])):
        thresh = 0
    else:
        thresh = 0.5
    n_samples = _num_samples(X)
    if (self.label_binarizer_.y_type_ == 'multiclass'):
        maxima = np.empty(n_samples, dtype=float)
        maxima.fill((- np.inf))
        argmaxima = np.zeros(n_samples, dtype=int)
        for (i, e) in enumerate(self.estimators_):
            pred = _predict_binary(e, X)
            np.maximum(maxima, pred, out=maxima)
            argmaxima[(maxima == pred)] = i
        return self.classes_[np.array(argmaxima.T)]
    else:
        indices = array.array('i')
        indptr = array.array('i', [0])
        for e in self.estimators_:
            indices.extend(np.where((_predict_binary(e, X) > thresh))[0])
            indptr.append(len(indices))
        data = np.ones(len(indices), dtype=int)
        indicator = sp.csc_matrix((data, indices, indptr), shape=(n_samples, len(self.estimators_)))
        return self.label_binarizer_.inverse_transform(indicator)
