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()
This is likely due to some of your packages being out of date. Please try updating tsibble, fable, and feasts.
Hi Sir,
Please note have updated tsibble ( 0.9.1 ) , fable (0.2.1 ) feast(0.1.4 ) the error still persists any other package need to update or is there a way to work around this error
Please provide a minimally reproducible example which includes your session info. This can be done by copying the problematic code and running reprex::reprex(si = TRUE)
. More info at https://www.tidyverse.org/help/
Hi Sir
Please note below is the output of reprex. Hope this is one you are referring to.
Pdf is attached.
reprex_1.pdf (59.6 KB)
Hi Sir ,
Please note attached is session details
Afraid this is not reproducible as C:/Users/Disha/Downloads/train_setav.csv is available only in your own environment.
This reprex()
does not load any of the required packages.
Try copying this code and running reprex()
:
library(fable)
as_tsibble(USAccDeaths) %>%
model(SNAIVE(value)) %>%
forecast()
You should get something like:
library(fable)
#> Loading required package: fabletools
as_tsibble(USAccDeaths) %>%
model(SNAIVE(value)) %>%
forecast()
#> # A fable: 24 x 4 [1M]
#> # Key: .model [1]
#> .model index value .mean
#> <chr> <mth> <dist> <dbl>
#> 1 SNAIVE(value) 1979 Jan N(7836, 312934) 7836
#> 2 SNAIVE(value) 1979 Feb N(6892, 312934) 6892
#> 3 SNAIVE(value) 1979 Mar N(7791, 312934) 7791
#> 4 SNAIVE(value) 1979 Apr N(8192, 312934) 8192
#> 5 SNAIVE(value) 1979 May N(9115, 312934) 9115
#> 6 SNAIVE(value) 1979 Jun N(9434, 312934) 9434
#> 7 SNAIVE(value) 1979 Jul N(10484, 312934) 10484
#> 8 SNAIVE(value) 1979 Aug N(9827, 312934) 9827
#> 9 SNAIVE(value) 1979 Sep N(9110, 312934) 9110
#> 10 SNAIVE(value) 1979 Oct N(9070, 312934) 9070
#> # … with 14 more rows
Created on 2020-07-12 by the reprex package (v0.3.0)
Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 3.6.2 (2019-12-12)
#> os Ubuntu 18.04.4 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language en_AU:en
#> collate en_AU.UTF-8
#> ctype en_AU.UTF-8
#> tz Australia/Melbourne
#> date 2020-07-12
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date lib source
#> anytime 0.3.7 2020-01-20 [1] CRAN (R 3.6.1)
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.1)
#> backports 1.1.7 2020-05-13 [1] RSPM (R 3.6.3)
#> callr 3.4.3 2020-03-28 [1] CRAN (R 3.6.2)
#> cli 2.0.2 2020-02-28 [1] RSPM (R 3.6.2)
#> colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.6.1)
#> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.1)
#> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.1)
#> devtools 2.3.0 2020-04-10 [1] RSPM (R 3.6.3)
#> digest 0.6.25 2020-02-23 [1] RSPM (R 3.6.2)
#> distributional 0.1.0.9000 2020-07-12 [1] local
#> dplyr 1.0.0 2020-05-29 [1] CRAN (R 3.6.2)
#> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 3.6.2)
#> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.1)
#> fable * 0.2.1.9000 2020-07-05 [1] local
#> fabletools * 0.2.0.9000 2020-07-12 [1] local
#> fansi 0.4.1 2020-01-08 [1] RSPM (R 3.6.2)
#> farver 2.0.3 2020-01-16 [1] CRAN (R 3.6.1)
#> fs 1.4.1 2020-04-04 [1] RSPM (R 3.6.3)
#> generics 0.0.2 2018-11-29 [1] CRAN (R 3.6.1)
#> ggplot2 3.3.1 2020-05-28 [1] CRAN (R 3.6.2)
#> glue 1.4.1 2020-05-13 [1] RSPM (R 3.6.3)
#> gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.1)
#> highr 0.8 2019-03-20 [1] CRAN (R 3.6.1)
#> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.1)
#> knitr 1.28 2020-02-06 [1] RSPM (R 3.6.2)
#> lifecycle 0.2.0 2020-03-06 [1] RSPM (R 3.6.3)
#> lubridate 1.7.9 2020-06-08 [1] CRAN (R 3.6.2)
#> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.1)
#> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.1)
#> munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.1)
#> pillar 1.4.4 2020-05-05 [1] RSPM (R 3.6.3)
#> pkgbuild 1.0.8 2020-05-07 [1] RSPM (R 3.6.3)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.1)
#> pkgload 1.1.0 2020-05-29 [1] CRAN (R 3.6.2)
#> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2)
#> processx 3.4.2 2020-02-09 [1] RSPM (R 3.6.2)
#> progressr 0.6.0 2020-05-19 [1] CRAN (R 3.6.2)
#> ps 1.3.3 2020-05-08 [1] RSPM (R 3.6.3)
#> purrr 0.3.4 2020-04-17 [1] RSPM (R 3.6.3)
#> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.1)
#> Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 3.6.2)
#> remotes 2.1.1 2020-02-15 [1] RSPM (R 3.6.2)
#> rlang 0.4.6 2020-05-02 [1] RSPM (R 3.6.3)
#> rmarkdown 2.3 2020-06-18 [1] RSPM (R 3.6.3)
#> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.1)
#> scales 1.1.1 2020-05-11 [1] RSPM (R 3.6.3)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.1)
#> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.2)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.1)
#> testthat 2.3.2 2020-03-02 [1] RSPM (R 3.6.3)
#> tibble 3.0.1 2020-04-20 [1] RSPM (R 3.6.3)
#> tidyr 1.1.0 2020-05-20 [1] RSPM (R 3.6.3)
#> tidyselect 1.1.0 2020-05-11 [1] RSPM (R 3.6.3)
#> tsibble 0.9.1.9000 2020-06-30 [1] local
#> usethis 1.6.1 2020-04-29 [1] RSPM (R 3.6.3)
#> utf8 1.1.4 2018-05-24 [1] CRAN (R 3.6.1)
#> vctrs 0.3.1 2020-06-05 [1] RSPM (R 3.6.3)
#> withr 2.2.0 2020-04-20 [1] RSPM (R 3.6.3)
#> xfun 0.14 2020-05-20 [1] RSPM (R 3.6.3)
#> yaml 2.2.1 2020-02-01 [1] RSPM (R 3.6.2)
#>
#> [1] /home/mitchell/R/x86_64-pc-linux-gnu-library/3.6
#> [2] /opt/R/3.6.2/lib/R/library
Hi Sir,
Please note below are attached files
reprex_reprex.3.pdf (49.8 KB) reprex_reprex2.pdf (58.0 KB)
system
Closed
August 2, 2020, 3:45pm
10
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.