Discussion: View Thread

  • 1.  Accuracy for regression models

    Posted 06-28-2023 13:01

    Hello everyone,

    I am doing some modeling for a client (linear regression) and they are insistent on being able to evaluate the model based on accuracy.  I've tried talking to them about the need to measure the model's performance based on RMSE, MSE, etc but they want to see its 'accuracy' expressed as a percentage.  Attempts to explain the difference between how we evaluate classification and regression models haven't been successful, yet.  Any advice from those who might have dealt with a similar issue?



    ------------------------------
    Chris Comora
    North Carolina State University
    ------------------------------


  • 2.  RE: Accuracy for regression models

    Posted 06-28-2023 14:58

    Hey Chris,

    Could you please clarify the source of conflict?

    Is the client asking you to:

    [A] Just evaluate the model's performance with respect to their desired metric? or

    [B] For you to deliver a linear regression model that has been trained/optimized with respect to their desired metric?

    If the answer is [A] then why not just (i) evaluate the current model with respect to their desired metric while (ii) warning them that the model is not optimized for this metric?

    The parameters of the linear regression model has (presumably) been fit to minimize RMSE / minimize MSE /  maximize likelihood / etc. So that metric is the objective function used to optimize the parameter values.

    In contrast, it sounds like the client want you to evaluate the performance of the model with respect to a different metric. Something like Mean Absolute Percentage error (MAPE).

    There's no inherent conflict of training/fitting a model with respect to one metric and then evaluating it with respect to a different metric...it's just that the regression model at hand isn't optimized for their preferred metric. The model is optimized for something with (i) a nice analytical solution,  (ii) easy gradients, (iii) a well understood set of statistical assumptions, etc.

    If the answer is [B]...

    This is actually pretty common though, where the real-world performance metric of the model is not identical to the metric you've used to fit the model. Bespoke performance metrics are extremely common in many applications. Again, people handle this by doing things like 

    • training the model on one metric and then evaluating the model's utility on a different metric (i.e., use solution A), or
    • develop heuristic techniques to fit/optimize the model according the bespoke performance metric.


    ------------------------------
    Glen Wright Colopy
    DPhil Oxon
    Host | The Data & Science Podcast
    Head of Data Science | Alesca Life Tech Ltd
    ------------------------------



  • 3.  RE: Accuracy for regression models

    Posted 06-28-2023 14:58

    How much data do you have? 

    A previous employer demanded to know the accuracy of a regression model. I told them the R^2 value is 0.99978, or whatever it was. That was what they wanted. 

    Something I did out of curiosity was to create  model with training data. Then look at how many of the testing data points for Y fit within +/- 1 SD, 2SD, etc. or within some relevant parameters say Y_hat +/- 5%, 10% etc. 



    ------------------------------
    Andrew Ekstrom

    Statistician, Chemist, HPC Abuser;-)
    ------------------------------



  • 4.  RE: Accuracy for regression models

    Posted 06-28-2023 15:42

    As a quick second on Andrew's comment with a very similar example to his (& apologies in advance for the self-citation), here's an example where....

    • a Gaussian process regression model* is constantly being re-fit to new data using maximum a posteriori (MAP)
    • but the "ultimate performance" of the model isn't the data with respect to the posterior predicted distribution....it's the lower quantiles of this performance.
    • In other words, for our clinical situation, we don't care if the model is very accurate & precise most of the time (on the easy patients), we want to reduce the severity of the very worst predictions.
    • So we developed an algo to identify models that optimize this analytical metric (in real time).

    Link to Downloadable PDF: https://ieeexplore.ieee.org/document/8226743

    Like the value of Andrew's follow-up analysis. Frequently the important part of a model is what it does when it get's things wrong, not how well it gets most thing right. That why it's important to not conflate "model performance metric" with "customer/user/business value".

    * If you're not familiar with GP regression, just think of it as linear regression over the kernel space...plop a kernels on each of the data points & regress over that so you can estimate non-linear functions without (m)any icky assumptions.



    ------------------------------
    Glen Wright Colopy
    DPhil Oxon
    Host | The Data & Science Podcast
    Head of Data Science | Alesca Life Tech Ltd
    ------------------------------



  • 5.  RE: Accuracy for regression models

    Posted 06-28-2023 16:13

    As a quick second to Glen's quick second ;-) I feel--heck, I KNOW this is not talked about enough in the applied world. I would personally like to see more formal coverage on the topic in applied stats courses--doesn't have to be extensive, just enough to make one think. There are many different ways to measure the "success" of a model, or rather, how you measure the "success" of the model depends on the practical objective of the model. In the end, what ultimately matters is how the decisions based on the model impact things that are real. Some of those metrics may not be "statistical" at all, so our responsibility becomes ensuring the model itself is "statistically sound" while maximizing whatever the objective function of interest....



    ------------------------------
    Michiko Wolcott
    Principal Consultant
    Msight Analytics
    ------------------------------



  • 6.  RE: Accuracy for regression models

    Posted 06-28-2023 16:26

    To expiate my sin of self-reference, here is another example of medical research that's grappling with the fact that the model is optimized for an *analytically-tractable* metric that's less important than an alternative metric (that's less analytically tractable).

    In this case it's (i) a logistic regression model with normal MLE training, versus (ii) the more useful metric is AUROC.

    Here the article link: Developing biomarker combinations in multicenter studies via direct maximization and penalization - PubMed

    Related work by Allison Meisner and others:

    • https://pubmed.ncbi.nlm.nih.gov/29344362/
    • https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5499057/


    ------------------------------
    Glen Wright Colopy
    DPhil Oxon
    Host | The Data & Science Podcast
    Head of Data Science | Alesca Life Tech Ltd
    ------------------------------



  • 7.  RE: Accuracy for regression models

    Posted 06-28-2023 17:23

    Even AUROC sometimes isn't practical enough.... it still can be difficult for making a business case, whose expectations are often measured in dollars and can come with additional constraints that do not necessarily impact model estimation but do impact the implementation of the decisions based on the model.

    There was a case in which the AUROC of one model was in the upper 80s and the other upper 70s (different designs and approaches). The model with AUROC in the upper 70s was clearly the winner because of how it performed around the constraints. In effect, the model with AUROC in the upper 80s did better (and quite a bit so) where it didn't matter in practice--outside of the so-called "operating range". The objective function here was dollars and there were constraints in the available workload and the associated costs to implement the decision. This was obviously not a "statistical" factor per se, but one that had an impact on a statistical decision (i.e., the selection of the final model). Sort of a poor man's constrained optimization, if you will.

    P.S. I have come across scenarios in which %accuracy in linear regression actually did translate to dollars and other indirect regulatory implications; I have actually seen models rejected because of lack of accuracy despite reasonable MSEs and such. So my question to the OP would be why the client is asking for it and what the intended use of the model is.

    I'll shut up now :-)



    ------------------------------
    Michiko Wolcott
    Principal Consultant
    Msight Analytics
    ------------------------------



  • 8.  RE: Accuracy for regression models

    Posted 06-28-2023 17:17

    Because the attempts to explain your perspective have not been successful, this might not be a statistical issue at all, but rather one of communication.  And if it's a communication problem, attempting a statistical fix might make the situation worse, not better.

    There are plenty of opportunities to miscommunicate.  Many clients use the same words as the statistician but with different meanings.  You might also have seen how some clients do not voluntarily disclose essential information to the statistician about their objectives, data, constraints, or other important aspects of their problems.

    When an impasse like this comes up -- or if there's even a hint that one might arise -- consider having a dialog in which you use your statistical expertise to help the client frame their problem in a way you mutually understand.

    As an example of the possibilities, your client might be in some combination of these situations (all of which I have encountered):

    • In previous work (or even the literature) somebody reported a model "accuracy" as a percentage of something, perhaps as 100*R^2, so that's what the client expects.
    • The client really understands everything and is trying to get you to optimize a loss function based on a relative error.
    • It is natural to express variation in the response variable as a percentage (and so perhaps the client needs you to model the logarithm of that variable, for instance).
    • The client has some frank misconceptions about the meanings of "accuracy" and/or "percentage."
    • The client has an altogether different conception of the purpose of the regression, perhaps intending to use it subsequently for classification.
    • The client doesn't understand their problem at all. (Maybe they are serving as an intermediary between you and the real client, such as their boss.)
    • The client needs to comply with a nonsensical government regulation and knows perfectly well a percentage measure might be inappropriate, but they have no choice.
    • ... (With sufficient imagination, you will be able to extend this list ad infinitum.)

    Evidently, eliciting this information requires as much (or more) listening as it does explanation.



    ------------------------------
    William Huber
    Quantitative Decisions/Analysis and Inference
    ------------------------------