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