Is there a way to generate a confidence interval from a cart lm object?

I would like to be able to generate a confidence interval from the model that I am creating using the package caret. This can be done using predict(model, data, interval = "confidence")when the model is created using lm(). However, when I try to use the same command with a model created using a function train(), I get the following error:

Error in extractPrediction(list(object), unkX = newdata, unkOnly = TRUE,  : 
  unused argument (interval = "confidence")

This is true even if I set method = "lm"to a function train. Does anyone know how to get the confidence interval from such an object? It is preferable to use the predictsame format.

Thank!

+4
source share
1 answer

, ! caret , . my_model_name$finalModel. , , predict(my_model_name$finalModel, my_data, interval = "confidence").

+4

All Articles