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

Add Prefix Parameter to lts for Tuning Spaces in Pipelines? #51

Open
giuseppec opened this issue Aug 8, 2024 · 0 comments
Open

Add Prefix Parameter to lts for Tuning Spaces in Pipelines? #51

giuseppec opened this issue Aug 8, 2024 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@giuseppec
Copy link

I wanted to use a search space for a pipeline and tried to rename the tuning space:

task = tsk("boston_housing")
tuner = tnr("random_search", batch_size = 3)

# Potentially large ML pipeline
xgb = as_learner(po("encode") %>>% lrn("regr.xgboost"))

search_space = lts("regr.xgboost.default")
# My attempt to rename the tuning space so that it matches the expected parameter names:
names(search_space$values) = paste0("regr.xgboost.", names(search_space$values)

at = auto_tuner(
  tuner = tuner,
  learner = xgb,
  search_space = search_space,
  resampling = rsmp("cv", folds = 2),
  measure = msr("regr.mse"),
  term_time = 20
)

at$train(task)

Maybe it could be useful to be able to allow passing a prefix to lts such as lts("regr.xgboost.default", param_set_prefix = "regr.xgboost.")?

The workaround is to use xgb = as_learner(po("encode") %>>% lts(lrn("regr.xgboost"))) maybe this can be mentioned in the book here?
Currently, the book only mentions that this is possible without mentioning a use case: "We could also apply the default search spaces from Bischl et al. (2023) by passing the learner to [lts()]".
Maybe one could add 1-2 more sentences to highlight that this can be useful if one wants to tune the learner parameters when the learner is combined with other pipeops?

@giuseppec giuseppec added enhancement New feature or request question Further information is requested labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant