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

set bonsai as dependency for "aorsf" #86

Merged
merged 2 commits into from
Jul 2, 2024
Merged

set bonsai as dependency for "aorsf" #86

merged 2 commits into from
Jul 2, 2024

Conversation

simonpcouch
Copy link
Contributor

Closes #85. Turns out both the extension package and the engine package need to be registered as dependencies for the socket cluster workers to know they need to load packages!

library(tidymodels)
library(bonsai)

library(future)
plan(multisession, workers = 5)

spec_rf <- 
  rand_forest(trees = 100, mtry = tune()) %>%
  set_mode("regression") %>% 
  set_engine("aorsf")

res_orf <- tune_grid(
  spec_rf,
  outcome ~ .,
  resamples = vfold_cv(sim_regression(1000))
)
#> i Creating pre-processing data to finalize unknown parameter: mtry
res_orf
#> # Tuning results
#> # 10-fold cross-validation 
#> # A tibble: 10 × 4
#>    splits            id     .metrics          .notes          
#>    <list>            <chr>  <list>            <list>          
#>  1 <split [900/100]> Fold01 <tibble [16 × 5]> <tibble [0 × 3]>
#>  2 <split [900/100]> Fold02 <tibble [16 × 5]> <tibble [0 × 3]>
#>  3 <split [900/100]> Fold03 <tibble [16 × 5]> <tibble [0 × 3]>
#>  4 <split [900/100]> Fold04 <tibble [16 × 5]> <tibble [0 × 3]>
#>  5 <split [900/100]> Fold05 <tibble [16 × 5]> <tibble [0 × 3]>
#>  6 <split [900/100]> Fold06 <tibble [16 × 5]> <tibble [0 × 3]>
#>  7 <split [900/100]> Fold07 <tibble [16 × 5]> <tibble [0 × 3]>
#>  8 <split [900/100]> Fold08 <tibble [16 × 5]> <tibble [0 × 3]>
#>  9 <split [900/100]> Fold09 <tibble [16 × 5]> <tibble [0 × 3]>
#> 10 <split [900/100]> Fold10 <tibble [16 × 5]> <tibble [0 × 3]>

Created on 2024-07-02 with reprex v2.1.0

@simonpcouch simonpcouch merged commit 4b4cc72 into main Jul 2, 2024
11 checks passed
@simonpcouch simonpcouch deleted the aorsf-85 branch July 2, 2024 21:29
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

Successfully merging this pull request may close these issues.

aorsf with doParallel cluster has interesting error
1 participant