[R] confusion matrix like detail with continuous data?
Ebert,Timothy Aaron
tebert @end|ng |rom u||@edu
Wed Feb 16 14:05:22 CET 2022
In your prediction you will have a target level of accuracy. Something like "I need to predict the slope of the regression to within 1%." You break your data into a training and testing data sets, then for the testing data set you ask is the prediction within 1% of the observed value. That is about as close as I can come as I have trouble thinking how to get a false positive out of a regression with a continuous dependent variable.
Of course, you have to have enough data that splitting the data set into two pieces leaves enough observations to make a reasonable model.
Tim
-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of Ivan Krylov
Sent: Wednesday, February 16, 2022 5:00 AM
To: r-help using r-project.org
Subject: Re: [R] confusion matrix like detail with continuous data?
[External Email]
On Tue, 15 Feb 2022 22:17:42 +0100
Neha gupta <neha.bologna90 using gmail.com> wrote:
> (1) Can we get the details like the confusion matrix with continuous
> data?
I think the closest you can get is a predicted-reference plot. That is, plot true values on the X axis and the corresponding predicted values on the Y axis.
Unsatisfying option: use cut() to transform a continuous variable into a categorical variable and make a confusion matrix out of that.
> (2) How can we get the mean absolute error for an individual instance?
> For example, if the ground truth is 4 and our model predicted as 6,
> how to find the mean absolute error for this instance?
Mathematically speaking, mean absolute error of an individual instance would be just the absolute value of the error in that instance, but that's probably not what you're looking for. If you need some kind of confidence bands for the predictions, it's the model's responsibility to provide them. There's lots of options, ranging from the use of the loss function derivative around the optimum to Monte-Carlo simulations.
For examples, see the confint() method.
--
Best regards,
Ivan
______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=n0Pz_t-BEeazrrz7r5DIs0qGgfyJ0E0_F5sGlJyjhnwJRydXFvfNs1g5Pe25PGK0&s=ZeN73VTXr4Z-qwxODgOWPyhqtvKWIXp6xVsLle-eWYA&e=
PLEASE do read the posting guide https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=n0Pz_t-BEeazrrz7r5DIs0qGgfyJ0E0_F5sGlJyjhnwJRydXFvfNs1g5Pe25PGK0&s=CqgXaJDSeFk1kD9-xcMjcbZYWKXSCkuJZodGf0yvRDk&e=
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list