Accuracy
noun
say it: “AK-yer-uh-see” /ˈækjərəsi/
The share of predictions that were correct, out of all the predictions made.
What is accuracy for a classifier?
Accuracy is the share of a classifier's guesses that are right: right guesses divided by all guesses. It's easy to read but can fool you when one class is rare: a fraud check that never flags anything is 99% accurate if 1% of payments are fraud.
from sklearn.metrics import accuracy_score
actual = ["spam", "ham", "ham", "spam", "ham"]
guessed = ["spam", "ham", "spam", "spam", "ham"]
print(accuracy_score(actual, guessed)) # 0.8: 4 of 5 right
In a sentence
- “The spam filter's accuracy was 0.8: four emails in five sorted right.”
- “High accuracy meant little, because 99% of the payments were fine anyway.”
Level: Apprentice · More AI Basics terms at this level
Updated