You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm unable to tune catboost (and lightgbm) in parallel using tune_race_anova. Both work sequentially. I've had this problem before but then I solved it with parsnip::set_dependency.
I get the same error when using tune_grid(). However, if I install development version of parsinp then tune_grid() works in parallel but tune_race_anova still fails with the same message.
I've tried to add catboost and treesnip to the pkgs argument in control_race without success.
This also seems to be connected to Windows as I was able to run this using docker.
Reproducible example
library(tidymodels)
library(catboost)
library(treesnip)
data_use_tbl<-mtcars %>%
as_tibble()
resamples<-data_use_tbl %>% vfold_cv()
rec<- recipe(mpg~., data=data_use_tbl)
boost_spec<- boost_tree(
mode="regression",
trees= tune(),
learn_rate= tune()
) %>%
set_engine("catboost", allow_writing_files=FALSE)
wflw<- workflow() %>%
add_recipe(rec) %>%
add_model(boost_spec)
set.seed(124)
parsnip::set_dependency("boost_tree", eng="catboost", pkg="catboost", mode="regression")
parsnip::set_dependency("boost_tree", eng="catboost", pkg="treesnip", mode="regression")
doParallel::registerDoParallel()
tune_results<-finetune::tune_race_anova(
object=wflw,
resamples=resamples,
grid=30,
control=finetune::control_race(allow_par=TRUE, verbose=TRUE)
)
#> Warning: All models failed. Run `show_notes(.Last.tune.result)` for more#> information.#> Error in `test_parameters_gls()`:#> ! There were no valid metrics for the ANOVA model.#> Backtrace:#> ▆#> 1. ├─finetune::tune_race_anova(...)#> 2. └─finetune:::tune_race_anova.workflow(...)#> 3. └─finetune:::tune_race_anova_workflow(...)#> 4. └─finetune:::test_parameters_gls(res, control$alpha)#> 5. └─rlang::abort("There were no valid metrics for the ANOVA model.")foreach::registerDoSEQ()
gc()
#> used (Mb) gc trigger (Mb) max used (Mb)#> Ncells 2640292 141.1 4318425 230.7 4318425 230.7#> Vcells 4517022 34.5 10146329 77.5 7006457 53.5
This issue seems better fit for the treesnip package, where there are a number of similar issues: curso-r/treesnip#69, curso-r/treesnip#68. We've created a follow-up package to treesnip, bonsai, and we absolutely plan on introducing support for catboost if/when the package makes it to CRAN!
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
The problem
I'm unable to tune catboost (and lightgbm) in parallel using
tune_race_anova
. Both work sequentially. I've had this problem before but then I solved it withparsnip::set_dependency
.I get the same error when using
tune_grid()
. However, if I install development version of parsinp thentune_grid()
works in parallel buttune_race_anova
still fails with the same message.I've tried to add catboost and treesnip to the pkgs argument in
control_race
without success.This also seems to be connected to Windows as I was able to run this using docker.
Reproducible example
Created on 2023-08-31 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: