scikit-learn 1 · Evaluation and tuning
Measure accuracy
The fraction of predictions that are correct. Be careful with imbalanced classes.
from sklearn.metrics import accuracy_score
print(accuracy_score(y_test, predictions))
Official scikit-learn 1 documentation
More evaluation and tuning commands
- Get precision, recall and F1
- See where the model is wrong
- Evaluate a regression model
- Cross-validate
- Tune hyperparameters
- See which features matter
All evaluation and tuning commands · scikit-learn 1 cheatsheet