Concepts / Evaluating Regression Models

Evaluating Regression Models

The business metric is the high-level goal an application serves, and model choices should be judged by their business impact on that goal.

  • Programming

A Score That Looks Too Good

A common first instinct when evaluating a classifier is to report one number, the fraction of predictions it gets right, and to treat a high number as proof that the model is good. The instinct feels reasonable, and it is often exactly where an evaluation goes wrong. This article follows a model through the evaluation process so you can see how a number that looks excellent can still fail at the job it was built to do, and what should replace a single accuracy score as the basis for judging a model.

What do you think happens?

Suppose 1 image in 100 contains a pedestrian. A model labels every single image as 'no pedestrian'. What accuracy does it score?

  • About 1%

  • About 50%

  • About 99%

  • About 100%

Reveal answer
Answer:

About 99%

99 of every 100 images are negative, and the model labels all of them negative, so 99 of 100 predictions are correct. The arithmetic is correct, but the model never finds a single pedestrian, which is the one thing the application needs it to do.

What the Business Metric Measures

Before choosing a metric, the starting question is what the application is actually for. A machine learning model is rarely the end product. Its predictions feed into a larger decision-making process, so the real interest lies in what those decisions achieve in the world. The high-level purpose of the application is called the business metric. It names the outcome an organization cares about, not the mathematical score used to check a model.

Definition

The business metric is the high-level goal an application serves. Model choices should be judged by their business impact on that goal, meaning the consequences that picking one particular algorithm has for that goal.

Business metrics come in many forms. Depending on the application, the goal might be avoiding traffic accidents, reducing the number of hospital admissions, attracting more visitors to a website, or getting shoppers to spend more money. Each of these goals describes a result that matters outside the model. The model is valuable only to the extent that it moves that result in the right direction.

Following a Model Choice to Its Consequences

Changing which model an application uses does not change the business metric directly. The change travels through a chain. The model produces predictions, the application turns those predictions into decisions, and those decisions produce outcomes that the business measures. Each link in that chain is a place where a model change can help, do nothing, or break the connection to the goal.

Model choicealgorithm and parametersModel predictionsraw output for each inputApplication decisionsactions taken frompredictionsBusiness metricthe outcome theorganization cares aboutproducesfeedsmoves
Changing the model changes its predictions, which change the application's decisions, which in turn move the business metric. The business metric is the end of the chain, not the model's score.

The difficulty is that the business impact of a model is often measurable only after it has been deployed in a real system. Deployment is usually the most expensive and risky point at which to find out whether the model was a good choice. The sensible move is to want an evaluation that reflects the business impact before deployment, even though the business metric itself is not yet available to read.

Why Teams Use Surrogate Metrics

During early development, and whenever a model is being tuned, it is often impractical to deploy it to the real world just to see how it performs. When the possible harm is high, such as a safety failure or a serious financial loss, testing in production is not an option. The usual answer is a surrogate evaluation procedure. A surrogate evaluation uses a metric that is easier to compute than the business metric, and that metric serves as a stand-in for it.

A surrogate metric is a stand-in. It is used when the business metric cannot be checked directly during offline evaluation, either because measuring it would require deployment or because the harm of finding out by deployment is too high. The surrogate is chosen because it is feasible to compute, not merely because it is convenient.

In the real world

Consider the pedestrian-avoidance capability of a self-driving car. The business goal is that pedestrians are not hurt. One way to check this would be to let the car drive around and watch what happens, but a faulty model would endanger people during that test. A safer surrogate is to test whether the model can classify images as containing a pedestrian or not, and to measure its accuracy on a labeled set of such images. That number is far easier to obtain, and it does not require anyone to stand near a moving car.

Choosing the Closest Feasible Metric

A surrogate is only a stand-in, so it deserves care. The guidance is to find the metric that comes as close as possible to the original business goal while still being feasible to evaluate. Whenever it can be used, that closest feasible metric should be the one used for model evaluation and selection. A surrogate that is easy to compute but drifts far from the business goal makes the evaluation look reliable while measuring something the application does not need.

The outcome of such an evaluation also need not be a single number. An algorithm might bring in ten percent more customers while each one spends fifteen percent less. The evaluation should still reflect the expected business impact of choosing one model over another, which means the trade-off between those effects matters, not just one headline figure.

Key point

When you choose a surrogate, ask two questions: can I compute it before deployment, and if the model improves on this number, does the business metric improve with it? A surrogate that fails the second question is a poor stand-in no matter how easy it is to compute.

Counting Outcomes for a Rare Positive Class

Binary classification, where each example is either in a positive class or a negative class, is arguably the most common and conceptually simple application of machine learning. The positive class is the one we are looking for, such as images that contain a pedestrian. Even in this simple setting, accuracy can hide important information. The counts of the four outcomes show what the single accuracy number is averaging over.

True positives: 0pedestrians correctlyflaggedAccuracy: 99%990 of 1,000 correctTrue positives: 8pedestrians correctlyflaggedAccuracy: 97.8%978 of 1,000 correctFalse negatives: 10pedestrians missedFalse negatives: 2pedestrians missedFalse positives: 0non-pedestrians flaggedFalse positives: 20non-pedestrians flaggedTrue negatives: 990non-pedestrians correctlypassedTrue negatives: 970non-pedestrians correctlypassed
The always-negative model scores higher on accuracy but finds no pedestrians. The detector scores lower on accuracy but catches most of the pedestrians it is meant to find.
Worked example

Reading accuracy from the four counts

A labeled set has 1,000 images, 10 of which contain a pedestrian. Compute the accuracy of the detector model, whose counts are true positives 8, false negatives 2, false positives 20, and true negatives 970.

  1. 1
    Count the correct predictions

    Correct predictions are the true positives and true negatives: 8 + 970 = 978.

  2. 2
    Count the total predictions

    The labeled set contains 1,000 images, so there are 1,000 predictions. Check: 8 + 2 + 20 + 970 = 1,000.

  3. 3
    Divide

    Accuracy is 978 divided by 1,000, which is 0.978, or 97.8%.

  4. 4
    Compare with the other model

    The always-negative model has accuracy 990 / 1,000 = 99%, which is higher. Yet it has zero true positives, so it never finds a pedestrian.

Result

The detector has accuracy 97.8%, lower than the always-negative model's 99%, but it is the only one of the two that does the job the application needs.

Rule

Why Accuracy Misleads When the Positive Class Is Rare

Accuracy can mislead in binary classification, especially when the positive class is rare, because a model can score highly while missing every positive case. The accuracy figure in that situation is correct as arithmetic but misleading as a measure of usefulness. The rarer the positive class, the more a model can gain in accuracy by ignoring it.

  • Common mistake

    Treating a high accuracy as proof that the model is good

    What it looks like

    A model that labels every image negative reaches 99% accuracy on a set where 1% of images contain a pedestrian.

    Why it fails

    Accuracy only reports the fraction of predictions that match. It says nothing about whether the rare class the application cares about was found.

    Do this instead

    Look at the counts of true positives, false negatives, false positives, and true negatives, and ask whether the positives are actually being caught.

  • Common mistake

    Choosing a surrogate because it is easy to compute, without checking its link to the goal

    What it looks like

    Selecting a model by a convenient number that improves while the application's real outcome stays flat.

    Why it fails

    A surrogate is a stand-in. If it drifts from the business goal, optimizing it does not improve the goal.

    Do this instead

    Pick the metric that comes as close as possible to the business goal while remaining feasible to evaluate.

  • Common mistake

    Assuming a single number always captures the full expected business impact

Applying the Closest-Metric Rule

MEDIUM

A team builds a classifier that flags transactions as fraudulent. Fraud is rare, and each missed fraud costs the business money. Explain why accuracy alone would be a risky choice, and describe what kind of surrogate metric you would prefer, using the rule of staying as close as possible to the business goal.

Hints
  • Start by naming the business metric. What outcome does the application serve?
  • Ask what happens to accuracy when the fraud class is rare and the model ignores it.
  • Your surrogate should be computable before deployment and should still track the cost of missed fraud.

Key Takeaways

  • The business metric is the high-level goal an application serves, and model choices should be judged by their business impact on that goal.
  • When the business impact is risky or infeasible to measure directly, a surrogate evaluation uses a metric that is easier to compute and stays as close to the business goal as possible.
  • Accuracy can mislead in binary classification when the positive class is rare, because a model can score highly while missing every positive case.
  • A single number may not capture the full expected business impact, so evaluation should reflect the consequences that matter to the application.

Related concepts

More concepts starting with E