Hi, all. I'm confused as to how to tune the scale_pos_weight
hyperparameter in xgboost models in tidymodels
. I've read the documentation but clearly am not implementing correctly. Would love help with this one!
xgb_spec <- boost_tree(
trees = tune(),
min_n = tune(),
mtry = tune(),
learn_rate = tune(),
scale_pos_weight = tune()
) %>%
set_engine("xgboost") %>%
set_mode("classification")
Error in boost_tree(trees = tune(), min_n = tune(), mtry = tune(), learn_rate = tune(), :
unused argument (scale_pos_weight = tune())
I have also tried:
- Using
scale_pos_weight(range = c(10, 200))
- Putting it in the
set_engine("xgboost", scale_pos_weight = tune())
I know that I can pass a given scale_pos_weight
value to xgboost via the set_engine statement, but I'm stumped as to how to tune it though from the closed issues on GitHub, it is clearly possible.
Would appreciate any help!
Thank you all so much!