42 points · by ahmedbesbes · 9y ago · 12 comments
def compute_score(clf, X, y,scoring='accuracy'):
xval = cross_val_score(clf, X, y, cv = 5,scoring=scoring)
return np.mean(xval)
when they could have done: np.mean(cross_val_score(clf, X, y, cv = 5,scoring='accuracy'))B) they think they might want to look at the intermediate results, or compute additional statistics
xval is a terrible name, but it does make it easier to see what's being passed into np.mean.
Correct me if am a wrong, but this particular optimization looks as waste of (CPU) time.
Vide https://www.quora.com/Do-random-forests-tend-to-overfit-as-m...