'Return staged predictions for X.
The predicted class of an input sample is computed as the weighted mean
prediction of the classifiers in the ensemble.
This generator method yields the ensemble prediction after each
iteration of boosting and therefore allows monitoring, such as to
determine the prediction on a test set after each boost.
Parameters
X : array-like of shape = [n_samples, n_features]
The input samples.
Returns
y : generator of array, shape = [n_samples]
The predicted classes.'

def staged_predict(self, X):

    n_classes = self.n_classes_
    classes = self.classes_
    if (n_classes == 2):
        for pred in self.staged_decision_function(X):
            (yield np.array(classes.take((pred > 0), axis=0)))
    else:
        for pred in self.staged_decision_function(X):
            (yield np.array(classes.take(np.argmax(pred, axis=1), axis=0)))
