Model Evaluation

Model evaluation is the process of measuring how well a trained machine learning model performs, using held-out test data and metrics like accuracy, precision, recall, or error.

Data & AI

Evaluation tells you whether a model is good enough to use and helps you compare different models. The golden rule is to evaluate on data the model has never seen during training, so the score reflects real-world performance rather than memorization.

Which metric to focus on depends on the problem: accuracy for balanced classification, precision and recall for imbalanced data, and error measures like mean squared error for regression. Techniques like cross-validation give more reliable estimates.

Examples

Python

from sklearn.model_selection import cross_val_score

scores = cross_val_score(model, X, y, cv=5)
print("mean accuracy:", round(scores.mean(), 2))

Output:

mean accuracy: 0.95

Learn it in a lesson

See also

Back to the Dictionary