You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am teaching myself how this function works by tuning it. I may be mistaken, but I do not think ets and loss arguments should be present in a model that is based on ARIMA. Again I may be wrong.
I was trying to tune these parameters and it trows errors as seen in the code below. PS. thanks for your contributions!!
I am teaching myself how this function works by tuning it. I may be mistaken, but I do not think ets and loss arguments should be present in a model that is based on ARIMA. Again I may be wrong.
I was trying to tune these parameters and it trows errors as seen in the code below. PS. thanks for your contributions!!
library(dplyr)
library(parsnip)
library(rsample)
library(timetk)
library(modeltime)
library(smooth)
Data
m750 <- m4_monthly %>% filter(id == "M750")
Split Data 80/20
set.seed(1234)
splits <- initial_time_split(m750, prop = 0.8)
set.seed(456)
time_roll <-
rolling_origin(
data = training(splits),
initial = round(nrow(training(splits)) * 0.75),
assess = 24,
cumulative = TRUE,
skip = TRUE
)
recipe
rec <- recipe(value ~ date, data = training(splits)) %>%
step_log(value)
Model Spec
model_spec <-
modeltime::adam_reg(
ets_model = tune("ets"),
# loss = tune("loss")
) %>%
set_engine('adam')
selecting terms to be tuned
ets_params <-
crossing(
error = c("A", "M"),
trend = c("N", "A", "Ad", "M", "Md"),
seasonality = c("N", "A", "M")
) %>%
mutate(comb = paste0(error, trend, seasonality)) %>%
pull(comb) %>%
sample(2) # randomly selecting 2 ets terms to be tuned
loss_params <-
c("likelihood", "MSE", "MAE", "HAM", "LASSO",
"RIDGE", "MSEh", "TMSE", "GTMSE", "MSCE") %>%
sample(2) # randomly selecting 2 loss terms to be tuned
tuning the model
adam_fit <-
workflow() %>%
add_model(model_spec) %>%
add_recipe(rec) %>%
tune_grid(
resamples = time_roll,
metrics = metric_set(rmse, rsq),
grid = crossing(
ets = loss_params,
)
)
the error
The text was updated successfully, but these errors were encountered: