Hi
Please note get an error when i try run the model TSLM , this error exists in the fit part marked in bold when i try to run the model on entire dataset.
Tried to run this model on single store_sku combiantion
it works fine both fit and forecast
Error Message:
Error in vctrs::vec_rbind(!!!lst_col) :
Internal error in vec_proxy_assign_opts()
: proxy
of type double
incompatible with value
proxy of type integer
.
Code
library(tidyverse)
library(fable)
library(tsibble)
library(tidyr)
library(tictoc)
library(future)
library(broom)
Importing and Storing Training Data
d_train<-read_csv('C:/Users/Disha/Downloads/train_setav.csv')
d_train$week =yearweek(d_train$week)
d_train <- as_tsibble(d_train,key=store_sku_id,index=week)
Importing and Storing Testing Data
d_test<-read_csv('C:/Users/Disha/Downloads/test_setav1.csv')
d_test$week = yearweek(d_test$week)
d_test <- as_tsibble(d_test,key=store_sku_id,index=week)
Running models on a single product store combination
d1_train <- filter(d_train,store_sku_id==2162338023)%>% select(week,units_sold)
d1_test <- filter(d_test,store_sku_id==2162338023)%>% select(week)
fit <- d1_train %>%
model(
#ets = ETS(units_sold),
#arima = ARIMA(units_sold),
lm = TSLM(units_sold ~ trend() + season())
)
f1<-fit %>%
forecast(h = 12)
print(f1)
accuracy(fit)
Train and Predict using the simple TSLM Model on the entire data no external variables considered
plan(multiprocess)
d_train0 <- d_train %>% select(week,units_sold)
tic()
fit <- d_train0 %>%
model(
lm = TSLM(units_sold ~ trend() + season())
)
plan(multiprocess)
tic()
f1<-fit %>% **
** forecast(h = 6) ## Here i get an error
toc()