Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A machine-learning model is good only if it performs well on the kind of data and for the decisions it is meant to support. Judge it on data it did not train on, use metrics that reflect the task and the cost of mistakes, and compare it with a simple baseline. No single score certifies a model as universally good.

What does a model evaluation actually tell you?

Evaluation estimates how well a model will predict beyond the examples used to fit it. A strong training score alone is not evidence that it will work on new data: as the scikit-learn getting-started guide puts it, “Fitting a model to some data does not entail that it will predict well on unseen data.”

A score is meaningful only alongside its setup: the prediction target, the metric, the evaluation data, and the way that data was selected. A result can be high yet fail to capture an important class, an expensive kind of error, or conditions that differ from the model’s intended use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a metric that matches the decision

Start with two questions: what is the model predicting, and what does a consequential mistake look like? The answer determines which metric is useful. As Google for Developers explains, “Which evaluation metrics are most meaningful depends on the specific model and the specific task, the cost of different misclassifications, and whether the dataset is balanced or imbalanced.”

Classification: accuracy, precision, and recall

Accuracy is the share of predictions that are correct. It is easy to interpret, but can obscure poor performance on a minority class. For example, a model that labels nearly every case as the majority class may achieve high accuracy on an imbalanced dataset while missing many cases in the minority class.

  • Precision asks: of the cases the model predicted as positive, how many were actually positive? It makes false positives visible.
  • Recall asks: of all the actual positive cases, how many did the model find? It makes false negatives visible.

These measures expose different error tradeoffs; neither is automatically the right choice. Consider the relative costs of false positives and false negatives, the class balance, and how predictions will be used. If a benchmark or application already defines a scoring function, use it for that comparison; otherwise, begin with the practical goal.

Rank #2
Sale
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems
  • Use scikit-learn to track an example ML project end to end
  • Explore several models, including support vector machines, decision trees, random forests, and ensemble methods
  • Exploit unsupervised learning techniques such as dimensionality reduction, clustering, and anomaly detection
  • Dive into neural net architectures, including convolutional nets, recurrent nets, generative adversarial networks, autoencoders, diffusion models, and transformers
  • Use TensorFlow and Keras to build and train neural nets for computer vision, natural language processing, generative models, and deep reinforcement learning

Probability predictions: log loss and Brier score

When a model produces probabilities rather than only class labels, evaluate the probabilities themselves. Log loss and Brier score are examples of metrics for probabilistic classification. The scikit-learn metrics guide describes Brier score as a strictly proper scoring rule reflecting calibration (reliability), discrimination (resolution), and outcome uncertainty. A lower Brier loss does not necessarily mean better calibration alone: discrimination can also affect the score. Do not treat Brier score by itself as a pure calibration measure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Regression: choose the error target deliberately

Regression metrics encode different goals. Squared error targets the conditional mean; absolute error targets the median; pinball loss targets a chosen quantile. Choose according to what the prediction is meant to represent and how errors matter in practice. Report the units and practical significance of errors where possible, rather than ranking models by metric name alone.

R-squared is dependent on the dataset and may not be meaningfully comparable across different datasets, according to the scikit-learn metrics guide. A metric that summarizes fit is not a substitute for checking whether the model’s errors are acceptable for the intended decision.

Separate model development from the final evaluation

Use data not involved in fitting to check prediction on unseen examples. A practical evaluation process distinguishes three roles for data:

  • Training data: used to fit the model’s parameters.
  • Validation data or cross-validation: used to compare approaches and make development choices.
  • Test data: held back for a final estimate once those choices are settled.

A train/test split offers a direct check, while cross-validation evaluates across multiple partitions. A single split can affect the result, and cross-validation helps show how performance varies across partitions. The scikit-learn cross-validation guide notes that results can depend on the particular random choice of training and validation sets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not repeatedly consult the test set while changing the model. If its results guide those changes, it has become part of model selection rather than an independent final check. Cross-validation also cannot make unrepresentative data representative: the evaluation data and split strategy still need to reflect the intended prediction setting. The right strategy can depend on the application, such as whether predictions concern future time periods or related groups; no single split choice fits every domain.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use a baseline and inspect the errors

Compare the model with a simple reference so its score has context. Scikit-learn identifies dummy estimators as useful baselines: they show what the chosen metric looks like without a sophisticated predictive approach. Beating a baseline is useful evidence of added predictive value, but does not by itself establish that a model is practically valuable or suitable for deployment.

Then look beyond the headline score. Check which cases are misclassified, whether false positives or false negatives are concentrated in a consequential part of the task, and how large regression errors are in relevant units. Also ask whether the test data captures the conditions in which the model will be used. The scikit-learn inspection guide notes that predictive performance is often the main goal of developing models, but a scalar score cannot describe every relevant error pattern or domain assumption.

A practical way to decide between models

  1. Define the prediction and decision. State what the model predicts and what happens when it is wrong.
  2. Select a task-aligned metric. Account for class balance, error costs, probability quality, or the regression target.
  3. Set aside representative evaluation data. Use a development procedure such as validation or cross-validation, and retain a test set for the final estimate.
  4. Compare with a simple baseline. Interpret the improvement using the same metric and evaluation setup.
  5. Inspect error patterns and assumptions. Decide whether the errors and evaluation conditions are acceptable for the intended use.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.