Skip to main content
AI & ML Output Prediction Medium +20 XP

Model Accuracy

What does model.score() return?

AI & MLRead-only
accuracy = model.score(X_test, y_test)
print(accuracy)

What is the output?

Show answer and explanation

Answer: Accuracy between 0 and 1

score() on a classifier returns accuracy as a float between 0.0 and 1.0 (e.g., 0.95 = 95% accuracy).

Hint: It's a proportion, not a count.

What this challenge tests

Output Prediction in AI & ML: sklearn, evaluation.

Related challenges