Closed ssoftcheck closed 4 years ago
If you've updated to the latest version(s) of tsibble (v0.9.0) or dplyr (v1.0.0), the current CRAN version of fabletools is incompatible with them.
The development version has fixed these issues, and I am working on getting the update on CRAN.
Hi Mitchel,
I just tried the development versions of tsibble (v0.9.0.900), fabletools (0.2.0), fable (0.2.1).
There is still an issue when using accuracy(validation_set) with a message below:
Error in vec_c(...) : Error in vec_c(...) :
Internal error in vec_proxy_assign_opts()
: proxy
of type double
incompatible with value
proxy of type integer
.
Meanwhile, accuracy() applied to the training set works fine.
It is also noted here that forecast() works only when fitting one model, e.g. fitModel = train_data %>% model (arima = ARIMA(y)). If there are more than 1 models, e.g. fitModel = train_data %>% model (trend = TSLM(y ~ trend()), arima = ARIMA(y)), there is an error message:
Error in vctrs::vec_rbind(!!!lst_col) : 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
.
Thank you! Nguyen
Could you post a reproducible example that includes your session info?
This can be done with reprex::reprex(si = TRUE)
.
Sorry, my project is entirely on Databricks with big datasets read from a database, so not sure how to post it here.
Sure, could you instead post the results of sessionInfo()?
Please find results of sessionInfo() below:
R version 3.6.2 (2019-12-12) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.6 LTS
Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.12.8 fable_0.2.1 feasts_0.1.4 fabletools_0.2.0
[5] tsibbledata_0.2.0 tsibble_0.9.0.9000 lubridate_1.7.4 fpp3_0.3
[9] forcats_0.4.0 stringr_1.4.0 dplyr_1.0.0 purrr_0.3.3
[13] readr_1.3.1 tidyr_1.0.0 tibble_3.0.1 ggplot2_3.2.1
[17] tidyverse_1.3.0 sparklyr_1.0.4 SparkR_2.4.5
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 lattice_0.20-38 forge_0.2.0 assertthat_0.2.1
[5] rprojroot_1.3-2 digest_0.6.25 utf8_1.1.4 R6_2.4.0
[9] cellranger_1.1.0 backports_1.1.5 reprex_0.3.0 httr_1.4.1
[13] pillar_1.4.4 TeachingDemos_2.10 rlang_0.4.6 lazyeval_0.2.2
[17] readxl_1.3.1 rstudioapi_0.11 r2d3_0.2.3 htmlwidgets_1.5.1
[21] munsell_0.5.0 broom_0.5.6 anytime_0.3.7 compiler_3.6.2
[25] modelr_0.1.8 pkgconfig_2.0.3 base64enc_0.1-3 Rserve_1.8-6
[29] urca_1.3-0 htmltools_0.4.0 tidyselect_1.1.0 fansi_0.4.0
[33] crayon_1.3.4 dbplyr_1.4.2 withr_2.1.2 grid_3.6.2
[37] nlme_3.1-144 jsonlite_1.6.1 gtable_0.3.0 lifecycle_0.2.0
[41] DBI_1.0.0 magrittr_1.5 scales_1.1.1 cli_2.0.2
[45] stringi_1.4.3 hwriter_1.3.2 fs_1.3.1 xml2_1.2.2
[49] ellipsis_0.3.0 generics_0.0.2 vctrs_0.3.1 hwriterPlus_1.0-3
[53] tools_3.6.2 glue_1.4.1 hms_0.5.3 colorspace_1.4-1
[57] rvest_0.3.5 haven_2.3.1
While it looks like you're using fabletools v0.2.0, the output suggests that you are using v0.1.3. Have you recently updated your packages? If so, perhaps the fable was created using an older version of fabletools, and you are trying to compute the accuracy of it using the newer version.
Thanks, Mitchell. To make sure, I reinstalled tsibble, fabletools, fable, and feasts in this order, and reran. There is still an error message of
" Error in vctrs::vec_rbind(!!!lst_col) : 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
."
Below is what I loaded and what sessionInfo said: library(SparkR) library(sparklyr) library(tidyverse)
library(tsibble) library(fabletools) library(fable) library(feasts)
library(data.table)
sessionInfo()
R version 3.6.2 (2019-12-12) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.6 LTS
Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.12.8 feasts_0.1.4 fable_0.2.1 fabletools_0.2.0
[5] tsibble_0.9.0.9000 forcats_0.4.0 stringr_1.4.0 dplyr_1.0.0
[9] purrr_0.3.4 readr_1.3.1 tidyr_1.1.0 tibble_3.0.1
[13] ggplot2_3.3.1 tidyverse_1.3.0 sparklyr_1.0.4 SparkR_2.4.5
[17] remotes_2.1.1 devtools_2.3.0 usethis_1.6.1
loaded via a namespace (and not attached):
[1] nlme_3.1-144 fs_1.3.1 lubridate_1.7.9
[4] httr_1.4.1 rprojroot_1.3-2 tools_3.6.2
[7] backports_1.1.7 R6_2.4.1 DBI_1.0.0
[10] colorspace_1.4-1 withr_2.2.0 tidyselect_1.1.0
[13] prettyunits_1.1.1 processx_3.4.2 curl_4.2
[16] compiler_3.6.2 progressr_0.6.0 cli_2.0.2
[19] rvest_0.3.5 forge_0.2.0 xml2_1.2.2
[22] desc_1.2.0 scales_1.1.1 callr_3.4.3
[25] digest_0.6.25 base64enc_0.1-3 pkgconfig_2.0.3
[28] htmltools_0.4.0 sessioninfo_1.1.1 dbplyr_1.4.2
[31] htmlwidgets_1.5.1 rlang_0.4.6 readxl_1.3.1
[34] rstudioapi_0.11 generics_0.0.2 farver_2.0.3
[37] hwriter_1.3.2 jsonlite_1.6.1 distributional_0.1.0
[40] magrittr_1.5 Rcpp_1.0.4.6 munsell_0.5.0
[43] fansi_0.4.1 lifecycle_0.2.0 stringi_1.4.6
[46] pkgbuild_1.0.8 grid_3.6.2 crayon_1.3.4
[49] lattice_0.20-38 haven_2.3.1 hms_0.5.3
[52] anytime_0.3.7 ps_1.3.3 pillar_1.4.4
[55] Rserve_1.8-6 pkgload_1.1.0 reprex_0.3.0
[58] urca_1.3-0 glue_1.4.1 modelr_0.1.8
[61] vctrs_0.3.1 testthat_2.3.2 cellranger_1.1.0
[64] gtable_0.3.0 assertthat_0.2.1 TeachingDemos_2.10
[67] r2d3_0.2.3 broom_0.5.6 memoise_1.1.0
[70] ellipsis_0.3.1 hwriterPlus_1.0-3
Note that the error message:
"Error in vctrs::vec_rbind(!!!lst_col) : 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
."
popped up after I called fitModel %>% forecast(h) when I tried to fit more than 1 model in fitModel = model(model1 =….., model2= ……).
If fitting just one model, then forecast(h) worked, but then accuracy(test_set) did not:
" Error in vec_c(...) : Error in vec_c(...) :
Internal error in vec_proxy_assign_opts()
: proxy
of type double
incompatible with value
proxy of type integer
."
Thank you!
Let's try to simplify the problem by using a smaller dataset we both have access to. Can you see if this code works for you?
library(fable)
#> Loading required package: fabletools
library(tsibble)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
model_data <- as_tsibble(cbind(mdeaths, fdeaths)) %>% rename(date = index, target = value)
train.limit <- yearmonth("1979 Jan")
models = model_data %>% filter(date < train.limit) %>%
model(
arima=ARIMA(target ~ pdq(p=0:5, d=0:1, q=0:5) + PDQ(P=0:1,D=0:1,Q=0:1), ic = "aicc", greedy = FALSE, stepwise = FALSE)
,arima_log=ARIMA(log(target) ~ pdq(p=0:5, d=0:2, q=0:5) + PDQ(P=0:1, D=0:1, Q=0:1), ic="aicc", greedy=FALSE, stepwise=FALSE)
,arima_trend=ARIMA(target ~ trend() + pdq(p=0:5, d=0:1, q=0:5) + PDQ(P=0:1,D=0:1,Q=0:1), ic = "aicc", greedy = FALSE, stepwise = FALSE)
,arima_log_trend=ARIMA(log(target) ~ trend() + pdq(p=0:5, d=0:2, q=0:5) + PDQ(P=0:1, D=0:1, Q=0:1), ic="aicc", greedy=FALSE, stepwise=FALSE)
)
models %>% forecast(h=12) %>% accuracy(model_data)
#> # A tibble: 8 x 10
#> .model key .type ME RMSE MAE MPE MAPE MASE ACF1
#> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 arima fdeaths Test 3.37 36.8 27.8 0.674 5.27 0.370 -0.398
#> 2 arima mdeaths Test 29.6 118. 83.3 2.09 6.12 0.472 -0.424
#> 3 arima_log fdeaths Test -20.3 43.3 27.7 -3.37 5.10 0.369 -0.171
#> 4 arima_log mdeaths Test 13.9 125. 83.4 0.586 5.77 0.473 -0.0990
#> 5 arima_log_trend fdeaths Test 12.1 46.4 33.3 0.981 5.45 0.444 0.620
#> 6 arima_log_trend mdeaths Test -23.1 138. 102. -2.62 6.89 0.580 -0.0729
#> 7 arima_trend fdeaths Test 13.3 56.8 41.5 0.686 6.95 0.553 0.669
#> 8 arima_trend mdeaths Test -23.1 148. 115. -3.03 8.09 0.649 0.162
Created on 2020-06-12 by the reprex package (v0.3.0)
I just tried commit 552c764 and the accuracy issue is solved. there were some new, unexpected (to me) renaming's.
i have no issue with forecast from a mable with multiple models
@mitchelloharawild since this issue was about the accuracy() function, should I close this?
Thanks, but it did not work:
"Error : Could not find response variable(s) in the fable: target"
sessionInfo()
R version 3.6.2 (2019-12-12) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.6 LTS
Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] remotes_2.1.1 devtools_2.3.0 usethis_1.6.1 dplyr_1.0.0
[5] tsibble_0.9.0.9000 fable_0.2.1 fabletools_0.2.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 urca_1.3-0 pillar_1.4.4 compiler_3.6.2
[5] TeachingDemos_2.10 prettyunits_1.1.1 tools_3.6.2 testthat_2.3.2
[9] pkgload_1.1.0 pkgbuild_1.0.8 digest_0.6.25 lubridate_1.7.9
[13] memoise_1.1.0 lifecycle_0.2.0 tibble_3.0.1 gtable_0.3.0
[17] nlme_3.1-144 anytime_0.3.7 lattice_0.20-38 pkgconfig_2.0.3
[21] rlang_0.4.6 cli_2.0.2 curl_4.2 hwriter_1.3.2
[25] withr_2.2.0 desc_1.2.0 generics_0.0.2 vctrs_0.3.1
[29] fs_1.3.1 feasts_0.1.4 rprojroot_1.3-2 grid_3.6.2
[33] tidyselect_1.1.0 glue_1.4.1 R6_2.4.1 processx_3.4.2
[37] fansi_0.4.1 sessioninfo_1.1.1 callr_3.4.3 ggplot2_3.3.1
[41] purrr_0.3.4 tidyr_1.1.0 SparkR_2.4.5 magrittr_1.5
[45] htmltools_0.4.0 hwriterPlus_1.0-3 backports_1.1.7 ps_1.3.3
[49] scales_1.1.1 ellipsis_0.3.1 assertthat_0.2.1 Rserve_1.8-6
[53] colorspace_1.4-1 munsell_0.5.0 crayon_1.3.4
I just tried commit 552c764 and the accuracy issue is solved. there were some new, unexpected (to me) renaming's.
* ".distribution" has become the target variable name * ".mean" has become the forecast * unnest_tsibble() no longer works on the confidence interval, but unpack_hilo() does
i have no issue with forecast from a mable with multiple models
@mitchelloharawild since this issue was about the accuracy() function, should I close this?
Please refer to the changes documented in the news: https://fabletools.tidyverts.org/dev/news/index.html The fable has changed to emphasise distributions, which are now provided by the distributional package (http://pkg.mitchelloharawild.com/distributional/). This package makes it easy to compute point forecasts and other statistics from distributions, and so the point forecast column is now optional in the fable.
I'll make a note of unnest_tsibble()
no longer working, as the data structure for hilo objects has changed (you can now access lower, upper, and level using $
, or via unpack_hilo()
as you suggest).
We can keep this issue open until we solve @ilebizard's problem.
@ilebizard
Thanks, but it did not work:
"Error : Could not find response variable(s) in the fable: target"
I don't see how this is possible as this error no longer exists in the code for fabletools v0.2.0. e7510882ad40f28f9fcac12a062ed87514c46214
Can you try updating your packages again and running the minimal example above in a new R session?
Thanks, Mitchell. I reinstalled fresh tsibble, fabletools, and fable packages in this order and this example worked.
Quick question (just in case): If I install fable before fabletools (both are development versions), will fable pick up older fabletools that is on CRAN?
Installing dev fable will not install older versions of package dependencies.
Closing for lack of MRE. This appears to be an issue with using older package versions.
I have a mable for a variable called "target"
When I try to compute accuracy on the full data
I get the error "Could not find response variable(s) in the fable: target", although the variable "target" exists. I stepped through and when the validation occurs the target column exists as ".fc" and the distribution column exists as ".dist"
rlang trace