{"id":18520142,"url":"https://github.com/mlr-org/mlr3tuningspaces","last_synced_at":"2025-07-20T01:32:24.820Z","repository":{"id":37860662,"uuid":"363905415","full_name":"mlr-org/mlr3tuningspaces","owner":"mlr-org","description":"Collection of search spaces for hyperparameter optimization in the mlr3 ecosystem","archived":false,"fork":false,"pushed_at":"2025-05-17T06:20:55.000Z","size":7111,"stargazers_count":13,"open_issues_count":6,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-21T15:06:20.198Z","etag":null,"topics":["automl","hyperparameter-tuning","machine-learning","mlr3","r","r-package","tune","tuning"],"latest_commit_sha":null,"homepage":"https://mlr3tuningspaces.mlr-org.com","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlr-org.png","metadata":{"funding":{"github":"mlr-org"},"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-03T11:21:09.000Z","updated_at":"2025-05-17T06:16:52.000Z","dependencies_parsed_at":"2024-11-25T14:46:11.890Z","dependency_job_id":"7e996173-9ac0-4096-8a04-39fa1087b516","html_url":"https://github.com/mlr-org/mlr3tuningspaces","commit_stats":{"total_commits":120,"total_committers":6,"mean_commits":20.0,"dds":0.3916666666666667,"last_synced_commit":"2bcdfa5f7d6f9496a2eae7090fc81315689f573d"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/mlr-org/mlr3tuningspaces","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3tuningspaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3tuningspaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3tuningspaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3tuningspaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlr-org","download_url":"https://codeload.github.com/mlr-org/mlr3tuningspaces/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3tuningspaces/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266053826,"owners_count":23869496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automl","hyperparameter-tuning","machine-learning","mlr3","r","r-package","tune","tuning"],"created_at":"2024-11-06T17:18:46.312Z","updated_at":"2025-07-20T01:32:24.804Z","avatar_url":"https://github.com/mlr-org.png","language":"R","funding_links":["https://github.com/sponsors/mlr-org"],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\nbibliography: references.bib\n---\n\n```{r, include = FALSE}\nlibrary(mlr3misc)\nlibrary(utils)\nlibrary(mlr3tuningspaces)\nlibrary(data.table)\nsource(\"R/bibentries.R\")\nwriteLines(toBibtex(bibentries), \"references.bib\")\n\nlgr::get_logger(\"mlr3\")$set_threshold(\"warn\")\nlgr::get_logger(\"bbotk\")$set_threshold(\"warn\")\nset.seed(1)\noptions(\n    datatable.print.nrows = 10,\n    datatable.print.class = FALSE,\n    datatable.print.keys = FALSE,\n    width = 100)\n```\n\n# mlr3tuningspaces \u003cimg src=\"man/figures/logo.png\" align=\"right\" width = \"120\" /\u003e\n\nPackage website: [release](https://mlr3tuningspaces.mlr-org.com/) | [dev](https://mlr3tuningspaces.mlr-org.com/dev/)\n\n\u003c!-- badges: start --\u003e\n[![r-cmd-check](https://github.com/mlr-org/mlr3tuningspaces/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/mlr-org/mlr3tuningspaces/actions/workflows/r-cmd-check.yml)\n[![CRAN Status](https://www.r-pkg.org/badges/version-ago/mlr3tuningspaces)](https://cran.r-project.org/package=mlr3tuningspaces)\n[![StackOverflow](https://img.shields.io/badge/stackoverflow-mlr3-orange.svg)](https://stackoverflow.com/questions/tagged/mlr3)\n[![Mattermost](https://img.shields.io/badge/chat-mattermost-orange.svg)](https://lmmisld-lmu-stats-slds.srv.mwn.de/mlr_invite/)\n\u003c!-- badges: end --\u003e\n\n*mlr3tuningspaces* is a collection of search spaces for hyperparameter optimization in the [mlr3](https://github.com/mlr-org/mlr3/) ecosystem.\nIt features ready-to-use search spaces for many popular machine learning algorithms.\nThe search spaces are from scientific articles and work for a wide range of data sets.\nCurrently, we offer tuning spaces from three publications.\n\n| Publication  | Learner | n Hyperparameter |\n| ------------ | ------- | ---------------- |\n| @bischl_2021 | glmnet  | 2                |\n|              | ranger  | 4                |\n|              | rpart   | 3                |\n|              | svm     | 4                |\n|              | xgboost | 8                |\n| @kuehn_2018  | glmnet  | 2                |\n|              | ranger  | 8                |\n|              | rpart   | 4                |\n|              | svm     | 5                |\n|              | xgboost | 13               |\n| @binder_2020 | glmnet  | 2                |\n|              | ranger  | 6                |\n|              | rpart   | 4                |\n|              | svm     | 4                |\n|              | xgboost | 10               |\n\n\n## Resources\n\nThere are several sections about hyperparameter optimization in the [mlr3book](https://mlr3book.mlr-org.com).\n\n* Getting started with the [book](https://mlr3book.mlr-org.com/chapters/chapter4/hyperparameter_optimization.html#sec-tuning-spaces) section on mlr3tuningspaces.\n* Learn about [search space](https://mlr3book.mlr-org.com/chapters/chapter4/hyperparameter_optimization.html#sec-learner-search-space).\n\n## Installation\n\nInstall the last release from CRAN:\n\n```{r eval = FALSE}\ninstall.packages(\"mlr3tuningspaces\")\n```\n\nInstall the development version from GitHub:\n\n```{r eval = FALSE}\nremotes::install_github(\"mlr-org/mlr3tuningspaces\")\n```\n\n## Example\n\n### Quick Tuning\n\nA learner passed to the `lts()` function arguments the learner with the default tuning space from @bischl_2021.\n\n```{r}\nlibrary(mlr3tuningspaces)\n\nlearner = lts(lrn(\"classif.rpart\"))\n\n# tune learner on pima data set\ninstance = tune(\n  tnr(\"random_search\"),\n  task = tsk(\"pima\"),\n  learner = learner,\n  resampling = rsmp(\"holdout\"),\n  measure = msr(\"classif.ce\"),\n  term_evals = 10\n)\n\n# best performing hyperparameter configuration\ninstance$result\n```\n\n### Tuning Search Spaces\n\nThe `mlr_tuning_spaces` dictionary contains all tuning spaces.\n\n```{r, eval=FALSE}\nlibrary(\"data.table\")\n\n# print keys and tuning spaces\nas.data.table(mlr_tuning_spaces)\n```\n\nA key passed to the `lts()` function returns the `TuningSpace`.\n\n```{r}\ntuning_space = lts(\"classif.rpart.rbv2\")\ntuning_space\n```\n\nGet the learner with tuning space.\n\n```{r}\ntuning_space$get_learner()\n```\n\n### Pipelines\n\nTuning spaces can be applied to the learners in a pipeline.\n\n```{r}\nlibrary(mlr3pipelines)\n\n# set default tuning space\ngraph_learner = as_learner(po(\"subsample\") %\u003e\u003e%\n  lts(lrn(\"classif.rpart\")))\n\n# set rbv2 tuning space\ntuning_space = lts(\"classif.rpart.rbv2\")\ngraph_learner$graph$pipeops$classif.rpart$param_set$set_values(.values = tuning_space$values)\n```\n\n### Adding New Tuning Spaces\n\nWe are looking forward to new collections of tuning spaces from peer-reviewed articles.\nYou can suggest new tuning spaces in an issue or contribute a new collection yourself in a pull request.\nTake a look at an already implemented collection e.g. our [default tuning spaces](https://github.com/mlr-org/mlr3tuningspaces/blob/main/R/tuning_spaces_default.R) from @bischl_2021.\nA `TuningSpace` is added to the ` mlr_tuning_spaces` dictionary with the  `add_tuning_space()` function.\nCreate a tuning space for each variant of the learner e.g. for `LearnerClassifRpart` and `LearnerRegrRpart`.\n\n```{r, eval=FALSE}\nvals = list(\n  minsplit  = to_tune(2, 64, logscale = TRUE),\n  cp        = to_tune(1e-04, 1e-1, logscale = TRUE)\n)\n\nadd_tuning_space(\n  id = \"classif.rpart.example\",\n  values = vals,\n  tags = c(\"default\", \"classification\"),\n  learner = \"classif.rpart\",\n  label = \"Classification Tree Example\"\n)\n```\n\nChoose a name that is related to the publication and adjust the documentation.\n\nThe reference is added to the `bibentries.R` file\n\n```{r, eval=FALSE}\nbischl_2021 = bibentry(\"misc\",\n  key           = \"bischl_2021\",\n  title         = \"Hyperparameter Optimization: Foundations, Algorithms, Best Practices and Open Challenges\",\n  author        = \"Bernd Bischl and Martin Binder and Michel Lang and Tobias Pielok and Jakob Richter and Stefan Coors and Janek Thomas and Theresa Ullmann and Marc Becker and Anne-Laure Boulesteix and Difan Deng and Marius Lindauer\",\n  year          = \"2021\",\n  eprint        = \"2107.05847\",\n  archivePrefix = \"arXiv\",\n  primaryClass  = \"stat.ML\",\n  url           = \"https://arxiv.org/abs/2107.05847\"\n)\n```\n\nWe are happy to help you with the pull request if you have any questions.\n\n## References\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlr-org%2Fmlr3tuningspaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlr-org%2Fmlr3tuningspaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlr-org%2Fmlr3tuningspaces/lists"}