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
- Measure accuracy
- Get precision, recall and F1
- See where the model is wrong
- Evaluate a regression model
- Tune hyperparameters
- See which features matter
All evaluation and tuning commands · scikit-learn 1 cheatsheet