def heldout_score(clf, X_test, y_test):
 score = np.zeros((n_estimators,), dtype=np.float64)
 for (i, y_pred) in enumerate(clf.staged_decision_function(X_test)):
  score[i] = clf.loss_(y_test, y_pred)
 return score

def heldout_score ( clf , X_test , y_test ) : score = np . zeros ( ( n_estimators , ) , dtype = np . float64 ) for ( i , y_pred ) in enumerate ( clf . staged_decision_function ( X_test ) ) : score [ i ] = clf . loss_ ( y_test , y_pred ) return score
compute deviance scores on x_test and y_test .