31
$\begingroup$

I've fitted my model and am trying to understand whether it's any good. I've calculated the recommended metrics to assess it ($R^2$/ AUC / accuracy / prediction error / etc) but do not know how to interpret them. In short, how do I tell if my model is any good based on the metric? Is an $R^2$ of 0.6 (for example) sufficient to let me proceed to draw inferences or base scientific/business decisions?


This question is intentionally broad, to cover a wide variety of situations that members frequently encounter; such questions could be closed as duplicates of this one. Edits to broaden the scope beyond the metrics mentioned here are welcome, as are additional answers - particularly those that offer insight about other classes of metrics.

$\endgroup$
4
  • 1
    $\begingroup$ Related: How to know that your machine learning problem is hopeless? As in "I have $R^2=0.6$, does that mean I can't improve it any further?" $\endgroup$ Jun 24, 2019 at 13:44
  • 3
    $\begingroup$ Base-line for $R^2$ or any other used metric? Going fro $R^2 = 0.03$ to $R^2 = 0.05$ can be an amazing performance jump in certain applications. This exactly how all reasonable publication work. We have a proposed model, we have a series of well-accepted metrics, we have knowledge of the "state-of-the-art" and we compare performance. And that's how we know if our model is any good. $\endgroup$
    – usεr11852
    Jun 27, 2019 at 21:03
  • 1
    $\begingroup$ Something I've noticed (at least in my own head) is that an absolute metric like $R^2$ (where we always know that $0.7$ is better than $0.6$) has appeal over something relative like RMSE (where you increase the RMSE just by changing the units from parsecs to nanometers), but then we get attached to the letter grade scale and start thinking that $R^2>0.9$ is an A, and $R^2 <0.6$ is an F. As noted, even a "F-scoring" $R^2$ could be quite good. $\endgroup$
    – Dave
    Nov 5, 2020 at 14:32
  • $\begingroup$ Two general comments that don't seem to arise directly in answers to date. 1. Don't confuse or conflate MSE and RMSE as MSE has units that are the square of those of the outcome variable, whereas RMSE has the same units as the outcome. 2. I prefer the interpretation of $R^2$ as the squared correlation between observed and predicted outcomes. For linear regression, this is the same as defined in terms of sum of squared errors of various kinds, but that's not always true. $R^2$ in this sense can be applied, with caref, to quite different models such as logit regression, at least descriptively. $\endgroup$
    – Nick Cox
    Nov 9, 2023 at 17:28

3 Answers 3

33
$\begingroup$

This answer will mostly focus on $R^2$, but most of this logic extends to other metrics such as AUC and so on.

This question can almost certainly not be answered well for you by readers at CrossValidated. There is no context-free way to decide whether model metrics such as $R^2$ are good or not. At the extremes, it is usually possible to get a consensus from a wide variety of experts: an $R^2$ of almost 1 generally indicates a good model, and of close to 0 indicates a terrible one. In between lies a range where assessments are inherently subjective. In this range, it takes more than just statistical expertise to answer whether your model metric is any good. It takes additional expertise in your area, which CrossValidated readers probably do not have.

Why is this? Let me illustrate with an example from my own experience (minor details changed).

I used to do microbiology lab experiments. I would set up flasks of cells at different levels of nutrient concentration, and measure the growth in cell density (i.e. slope of cell density against time, though this detail is not important). When I then modelled this growth/nutrient relationship, it was common to achieve $R^2$ values of >0.90.

I am now an environmental scientist. I work with datasets containing measurements from nature. If I try to fit the exact same model described above to these ‘field’ datasets, I’d be surprised if I the $R^2$ was as high as 0.4.

These two cases involve exactly the same parameters, with very similar measurement methods, models written and fitted using the same procedures - and even the same person doing the fitting! But in one case, an $R^2$ of 0.7 would be worryingly low, and in the other it would be suspiciously high.

Furthermore, we would take some chemistry measurements alongside the biological measurements. Models for the chemistry standard curves would have $R^2$ around 0.99, and a value of 0.90 would be worryingly low.


What leads to these big differences in expectations? Context. That vague term covers a vast area, so let me try to separate it into some more specific factors (this is likely incomplete):

1. What is the payoff / consequence / application?

This is where the nature of your field are likely to be most important. However valuable I think my work is, bumping up my model $R^2$s by 0.1 or 0.2 is not going to revolutionize the world. But there are applications where that magnitude of change would be a huge deal! A much smaller improvement in a stock forecast model could mean tens of millions of dollars to the firm that develops it.

This is even easier to illustrate for classifiers, so I’m going to switch my discussion of metrics from $R^2$ to accuracy for the following example (ignoring the weakness of the accuracy metric for the moment). Consider the strange and lucrative world of chicken sexing. After years of training, a human can rapidly tell the difference between a male and female chick when they are just 1 day old. Males and females are fed differently to optimize meat & egg production, so high accuracy saves huge amounts in misallocated investment in billions of birds. Till a few decades ago, accuracies of about 85% were considered high in the US. Nowadays, the value of achieving the very highest accuracy, of around 99%? A salary that can apparently range as high as 60,000 to possibly 180,000 dollars per year (based on some quick googling). Since humans are still limited in the speed at which they work, machine learning algorithms that can achieve similar accuracy but allow sorting to take place faster could be worth millions.

(I hope you enjoyed the example – the alternative was a depressing one about very questionable algorithmic identification of terrorists).

2. How strong is the influence of unmodelled factors in your system?

In many experiments, you have the luxury of isolating the system from all other factors that may influence it (that’s partly the goal of experimentation, after all). Nature is messier. To continue with the earlier microbiology example: cells grow when nutrients are available but other things affect them too – how hot it is, how many predators there are to eat them, whether there are toxins in the water. All of those covary with nutrients and with each other in complex ways. Each of those other factors drives variation in the data that is not being captured by your model. Nutrients may be unimportant in driving variation relative to the other factors, and so if I exclude those other factors, my model of my field data will necessarily have a lower $R^2$.

3. How precise and accurate are your measurements?

Measuring the concentration of cells and chemicals can be extremely precise and accurate. Measuring (for example) the emotional state of a community based on trending twitter hashtags is likely to be…less so. If you cannot be precise in your measurements, it is unlikely that your model can ever achieve a high $R^2$. How precise are measurements in your field? We probably do not know.

4. Model complexity and generalizability

If you add more factors to your model, even random ones, you will on average increase the model $R^2$ (adjusted $R^2$ partly addresses this). This is overfitting. An overfit model will not generalize well to new data i.e. will have higher prediction error than expected based on the fit to the original (training) dataset. This is because it has fit the noise in the original dataset. This is partly why models are penalized for complexity in model selection procedures, or subjected to regularization.

If overfitting is ignored or not successfully prevented, the estimated $R^2$ will be biased upward i.e. higher than it ought to be. In other words, your $R^2$ value can give you a misleading impression of your model’s performance if it is overfit.

IMO, overfitting is surprisingly common in many fields. How best to avoid this is a complex topic, and I recommend reading about regularization procedures and model selection on this site if you are interested in this.

5. Data range and extrapolation

Does your dataset extend across a substantial portion of the range of X values you are interested in? Adding new data points outside the existing data range can have a large effect on estimated $R^2$, since it is a metric based on the variance in X and Y.

Aside from this, if you fit a model to a dataset and need to predict a value outside the X range of that dataset (i.e. extrapolate), you might find that its performance is lower than you expect. This is because the relationship you have estimated might well change outside the data range you fitted. In the figure below, if you took measurements only in the range indicated by the green box, you might imagine that a straight line (in red) described the data well. But if you attempted to predict a value outside that range with that red line, you would be quite incorrect.

enter image description here

[The figure is an edited version of this one, found via a quick google search for 'Monod curve'.]

6. Metrics only give you a piece of the picture

This is not really a criticism of the metrics – they are summaries, which means that they also throw away information by design. But it does mean that any single metric leaves out information that can be crucial to its interpretation. A good analysis takes into consideration more than a single metric.


Suggestions, corrections and other feedback welcome. And other answers too, of course.

$\endgroup$
8
  • 3
    $\begingroup$ One thing to add to this excellent posting is that $R^2$ is about comparing explained and unexplained variance. A low $R^2$ can indicate problems with the model, however it can also indicate that whatever predictive variable is available doesn't really explain much of the variation in the data. In the latter case the model may be bad in some "absolute" sense like predictive accuracy, but good in the sense that there isn't any better, at least not with the available data. $\endgroup$ Jun 24, 2019 at 11:37
  • $\begingroup$ @Lewian Thank you for the feedback. I thought I had that covered in points 2 & 3, but I see that it can be improved. I will think about how to make that point more clearly. $\endgroup$
    – mkt
    Jun 24, 2019 at 11:39
  • 1
    $\begingroup$ Yes, I thought about whether this is already covered. The thing with 2 and 3 is that they give specific reasons why this could happen, however it is a general issue. $\endgroup$ Jun 24, 2019 at 11:41
  • $\begingroup$ @Lewian Agreed, I will give that some thought. $\endgroup$
    – mkt
    Jun 24, 2019 at 11:42
  • 1
    $\begingroup$ This is a great Q&A pair, +1 to both. I'm not sure the chicken example is going to age well, though, as we learn more about how the poultry industry operates. I might be an exception but find it very depressing. $\endgroup$
    – dipetkov
    Mar 8, 2023 at 9:37
3
$\begingroup$

This problem comes up in my field of hydrology when assessing how well models predict streamflow from rainfall and climate data. Some researchers (Chiew and McMahon, 1993) surveyed 93 hydrologists, (63 responded ) to find out what diagnostic plots and goodness of fit statistics they used, which were the most important, and how they were used to classify the quality of a model fit. The results are now dated but the approach may still be of interest. They presented the results of model fits of various qualities and asked hydrologists to classify them into 4 categories (1) perfectly acceptable result; (2) acceptable but use with reservation; (3) unacceptable, use only if there is no other alternative; and (4) never use under any condition.

The most important diagnostic graphs were timeseries plots and scatter plots of simulated and recorded flows from the data used for calibration. R-squared and Nash-Sutcliffe model efficiency coefficient (E) were the favoured goodness of fit statistics. For example, results were considered acceptable if E => 0.8

There are other examples in the literature. When assessing an ecosystem model in the North Sea, the following categorisation was used E > 0.65 excelled, 0.5 to 0.65 very good, 0.2 to 0.5 as good, and <0.2 as poor (Allen et al., 2007).

Moriasi et al., (2015) provides tables of acceptable values for metrics for various types of models.

I've summarised this information and references in a blog post.

Allen, J., P. Somerfield, and F. Gilbert (2007), Quantifying uncertainty in high‐resolution coupled hydrodynamic‐ecosystem models, J. Mar. Syst.,64(1–4), 3–14, doi:10.1016/j.jmarsys.2006.02.010.

Moriasi, D., Gitau, M. Pai, N. and Daggupati, P. (2015) Hydrologic and Water Quality Models: Performance Measures and Evaluation Criteria Transactions of the ASABE (American Society of Agricultural and Biological Engineers) 58(6):1763-1785

$\endgroup$
1
$\begingroup$

Just to add to the great answers above - in my experience, evaluation metrics and diagnostic tools are as good and honest as the person using them. That is, if you understand the mathematics behind them, then you can likely artificially increase them to make your model appear better without increasing its actual utility.

For example, like mentioned in one of the comments, in some applications $R^2=0.03 \to R^2 = 0.05$ can be a great performance boost. However, if this increase was obtained artificially (i.e., by arbitrarily removing some observations), then this performance increase is not sincere and arguably provides little utility.

I'll keep this answer short since the above do a great job providing explanations/references. I just wanted to add some perspective on the section on 6. Metrics only give you a piece of the picture by mkt's answer.

Hope this helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.