Description Usage Arguments Value Note Examples
Creates an exponential smoothing state space (ETS) model that is then fitted to the data as a univariate time series.
1 |
model |
Model type according to |
... |
Further arguments used when fitting ETS model. |
Model definition that can then be insered into train.
ETS model does not support exogenous variables. Yet, we need to supply some sample data when making predictions in order to work with caret. However, these values are ignored.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(caret)
library(forecast)
data(WWWusage) # from package "forecast"
data_train <- WWWusage[1:80]
data_test <- WWWusage[81:100]
lm <- train(data_train, method = "lm", trControl = trainDirectFit())
summary(lm)
RMSE(predict(lm, data_test), data_test)
ets <- train(data_train, method = ets_model(), trControl = trainDirectFit())
summary(ets)
RMSE(predict(ets, data_test), data_test)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.