Skip to content
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

Parallelization using future does not work with dynamic formula in model #193

Closed
KaroRonty opened this issue Apr 29, 2020 · 3 comments
Closed

Comments

@KaroRonty
Copy link

I have a model with lots of predictors so it would make sense to define the formula outside the model function, but it's not working using parallelization. The error message is "object 'f' not found".

# Preparing the data
library(fable)
library(tsibble)
library(dplyr)

train <- airquality %>% mutate(
    date = as.Date(paste('2018', Month, Day, sep = '-')), 
    Ozone = round(imputeTS::na.interpolation(Ozone, option = 'stine')),
    Solar.R = round(imputeTS::na.interpolation(Solar.R, option = 'stine'))
) %>% 
    as_tsibble()

# Defining the formula
f <- as.formula('Ozone ~ Wind + Temp + Solar.R')

# Works
fsModel <- train %>% 
    model(ARIMA(Ozone ~ Wind + Temp + Solar.R))

# Works
fsModel <- train %>% 
    model(ARIMA(formula = f))

library(future)

plan(multiprocess)

# Works
fsModel <- train %>% 
    model(ARIMA(Ozone ~ Wind + Temp + Solar.R))

# Does not work
fsModel <- train %>% 
    model(ARIMA(formula = f))
@mitchelloharawild
Copy link
Member

mitchelloharawild commented Apr 29, 2020

Thanks for the bug report. I'll be fixing up reconciliation next month.
This is a known issue covered by #146

@KaroRonty
Copy link
Author

Great! Sorry for opening a duplicate issue, seems like googling the packages in question doesn't bring all the results from github issues

@mitchelloharawild
Copy link
Member

No worries, hopefully others will find this issue then 😄

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

2 participants