'Return staged scores for X, y.
This generator method yields the ensemble score after each iteration of
boosting and therefore allows monitoring, such as to determine the
score 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.
y : array-like, shape = [n_samples]
Labels for X.
sample_weight : array-like, shape = [n_samples], optional
Sample weights.
Returns
z : float'

def staged_score(self, X, y, sample_weight=None):

    for y_pred in self.staged_predict(X):
        if is_classifier(self):
            (yield accuracy_score(y, y_pred, sample_weight=sample_weight))
        else:
            (yield r2_score(y, y_pred, sample_weight=sample_weight))
