Description Usage Arguments Value Examples
This function is an alternative training function with performs a direct fit only,
i.e. it avoids any kind of cross-validation or any form of repeated executions. It
is thus beneficial to use this training function when working with objects that
solely require a direct fit, such as a least squares, ARMA or ARIMA. It thereby
considerably reduces runtime compare to the default initialization of
trainControl
.
1 |
... |
Optional parameters passed on to |
An object that controls the training inside train
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(forecast)
data(WWWusage) # from package "forecast"
df <- data.frame(y = as.numeric(WWWusage))
library(caret)
lm <- train(y ~ 1, data = df, method = "lm", trControl = trainDirectFit())
summary(lm)
RMSE(predict(lm, df), df)
arima <- train(y ~ 1, data = df, method = arima_model(1, 1, 1), trControl = trainDirectFit())
summary(arima)
RMSE(predict(arima, df), df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.