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

All evaluation and tuning commands · scikit-learn 1 cheatsheet

Was this page helpful?