'Predict class probabilities for X.
The predicted class probabilities of an input sample is computed as
the weighted mean predicted class probabilities of the classifiers
in the ensemble.
Parameters
X : {array-like, sparse matrix} of shape = [n_samples, n_features]
The training input samples. Sparse matrix can be CSC, CSR, COO,
DOK, or LIL. DOK and LIL are converted to CSR.
Returns
p : array of shape = [n_samples]
The class probabilities of the input samples. The order of
outputs is the same of that of the `classes_` attribute.'

def predict_proba(self, X):

    check_is_fitted(self, 'n_classes_')
    n_classes = self.n_classes_
    X = self._validate_X_predict(X)
    if (n_classes == 1):
        return np.ones((X.shape[0], 1))
    if (self.algorithm == 'SAMME.R'):
        proba = sum((_samme_proba(estimator, n_classes, X) for estimator in self.estimators_))
    else:
        proba = sum(((estimator.predict_proba(X) * w) for (estimator, w) in zip(self.estimators_, self.estimator_weights_)))
    proba /= self.estimator_weights_.sum()
    proba = np.exp(((1.0 / (n_classes - 1)) * proba))
    normalizer = proba.sum(axis=1)[:, np.newaxis]
    normalizer[(normalizer == 0.0)] = 1.0
    proba /= normalizer
    return proba
