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

Model specifications not updated after finalizing or changing parameters #979

Open
marcelglueck opened this issue Feb 5, 2025 · 1 comment

Comments

@marcelglueck
Copy link

marcelglueck commented Feb 5, 2025

I would like to finalize the mtry parameter of the following model:

RF_model_specs <-
  rand_forest(
    trees = 1000,
    mtry = tune(),
    min_n = tune()) %>%
  set_engine("randomForest") %>% 
  set_mode("regression")

However, regardless of the approach I choose, the changed range of mtry is never reflected in the model specifications:

# Update mtry range (preferred over less flexible finalize() command)
> RF_max_mtry <- max(floor((ncol(x)-1)/3), 1)
> update(parameters(RF_model_specs), `mtry` = range_set(mtry(), c(1, RF_max_mtry)))
Collection of 2 parameters for tuning

 identifier  type    object
       mtry  mtry nparam[+]
      min_n min_n nparam[+]

# Check parameters underlying the model
> parameters(RF_model_specs)
Collection of 2 parameters for tuning

 identifier  type    object
       mtry  mtry nparam[?]
      min_n min_n nparam[+]

Model parameters needing finalization:
   # Randomly Selected Predictors ('mtry')

Is this a visual bug, or is the mtry parameter for the model really not set correctly after all?
Thanks!

Update: Obviously, the modified range was not parsed to mtry:

> mtry()
# Randomly Selected Predictors (quantitative)
Range: [1, ?]
@marcelglueck
Copy link
Author

Am I missing something? Should I re-post this at dial's Issues page?

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