Skip to content

(Gaps causing) missing test predictors gives confusing error #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brookslogan opened this issue Jul 18, 2024 · 2 comments
Closed

(Gaps causing) missing test predictors gives confusing error #362

brookslogan opened this issue Jul 18, 2024 · 2 comments

Comments

@brookslogan
Copy link
Contributor

brookslogan commented Jul 18, 2024

library(epipredict)
#> Loading required package: epiprocess
#> Registered S3 method overwritten by 'tsibble':
#>   method               from 
#>   as_tibble.grouped_df dplyr
#> 
#> Attaching package: 'epiprocess'
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> Loading required package: parsnip
#> Registered S3 method overwritten by 'epipredict':
#>   method            from   
#>   print.step_naomit recipes
jhu <- case_death_rate_subset %>%
  dplyr::filter(time_value >= as.Date("2021-12-01")) %>%
  dplyr::filter(time_value != max(time_value) - 7L)

out <- arx_forecaster(
  jhu, "death_rate",
  c("case_rate", "death_rate")
)
#> Error in `as_list_of()` at epipredict/R/dist_quantiles.R:63:3:
#> ! Can't find common type for elements of `x`.

Created on 2024-07-17 with reprex v2.1.1

Just skimming, it looks like there might be one underlying issue + a similar related issue in a separate branch of the same function:

  • get_test_data() with fill_locf = TRUE does not complete() before fill()-ing. To avoid this error, we'd might want it to complete() according to the requested lags and/or a guessed period(... or maybe restructure prediction entirely to somehow fill() and select test instances after baking the test data?) --- this appears to be the case we are in with arx_forecaster()
  • get_test_data() with fill_locf = FALSE probably doesn't raise a comprehensible error message in this case either. --- this is a related error case
@brookslogan
Copy link
Contributor Author

brookslogan commented Jul 18, 2024

Potential duplicate of #333? [Different error message though.]

@brookslogan
Copy link
Contributor Author

Once I fixed the example in #333, this does appear to be a duplicate. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant