How to find absolute residuals

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to find absolute residuals

khan123
I need the absolute residuals (actual-predicted values) in a table or
another sequential format so that I may perform statistical analysis on it
later.
I have the following function, so how can I get the residuals ?

grid_search <- train(log10(Results) ~ ., data = tr,
                     method = "svmRadial",
                     ## Will create 48 parameter combinations
                     ##  tuneLength = 15,
                     metric = "MAE",
                     preProc = c("center", "scale", "zv"),
                     trControl = ctrl2)

getTrainPerf(grid_search)

My test data is ts.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: How to find absolute residuals

Ivan Krylov
On Wed, 18 Dec 2019 10:06:56 +0100
javed khan <[hidden email]> wrote:

> grid_search <- train(log10(Results) ~ ., data = tr,
>                      method = "svmRadial",
>                      ## Will create 48 parameter combinations
>                      ##  tuneLength = 15,
>                      metric = "MAE",
>                      preProc = c("center", "scale", "zv"),
>                      trControl = ctrl2)

There is no "train" function in R core, so I'm going to invoke my
psychic debugging powers and determine that you are using the "caret"
package.

> I need the absolute residuals (actual-predicted values) in a table or
> another sequential format so that I may perform statistical analysis
> on it later.

Caret seems to provide a residuals() method for objects of class "train"
returned from the train() function. If all else fails, you could always
call predict() and compute the residuals yourself.

--
Best regards,
Ivan

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.