'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.
This generator method yields the ensemble predicted class probabilities
after each iteration of boosting and therefore allows monitoring, such
as to determine the predicted class probabilities on a test set after
each boost.
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 : generator of array, shape = [n_samples]
The class probabilities of the input samples. The order of
outputs is the same of that of the `classes_` attribute.'

def staged_predict_proba(self, X):

    X = self._validate_X_predict(X)
    n_classes = self.n_classes_
    proba = None
    norm = 0.0
    for (weight, estimator) in zip(self.estimator_weights_, self.estimators_):
        norm += weight
        if (self.algorithm == 'SAMME.R'):
            current_proba = _samme_proba(estimator, n_classes, X)
        else:
            current_proba = (estimator.predict_proba(X) * weight)
        if (proba is None):
            proba = current_proba
        else:
            proba += current_proba
        real_proba = np.exp(((1.0 / (n_classes - 1)) * (proba / norm)))
        normalizer = real_proba.sum(axis=1)[:, np.newaxis]
        normalizer[(normalizer == 0.0)] = 1.0
        real_proba /= normalizer
        (yield real_proba)
