scikit-learn 1 · Evaluation and tuning

Cross-validate

Score a model on five different train and test splits for a more reliable estimate.

from sklearn.model_selection import cross_val_score

scores = cross_val_score(clf, X, y, cv=5)
print(scores.mean(), scores.std())

Official scikit-learn 1 documentation

More evaluation and tuning commands

All evaluation and tuning commands · scikit-learn 1 cheatsheet

Was this page helpful?