{"id":18520183,"url":"https://github.com/mlr-org/mlr3fselect","last_synced_at":"2025-09-09T05:37:55.824Z","repository":{"id":40554449,"uuid":"198626258","full_name":"mlr-org/mlr3fselect","owner":"mlr-org","description":"Feature selection package of the mlr3 ecosystem.","archived":false,"fork":false,"pushed_at":"2025-08-16T11:29:43.000Z","size":15219,"stargazers_count":34,"open_issues_count":5,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-08-16T13:38:53.994Z","etag":null,"topics":["evolutionary-algorithms","exhaustive-search","feature-selection","machine-learning","mlr3","optimization","r","r-package","random-search","recursive-feature-elimination","sequential-feature-selection"],"latest_commit_sha":null,"homepage":"https://mlr3fselect.mlr-org.com/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","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":"LICENSE","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,"zenodo":null}},"created_at":"2019-07-24T11:55:21.000Z","updated_at":"2025-08-09T13:00:50.000Z","dependencies_parsed_at":"2023-12-15T16:26:40.994Z","dependency_job_id":"e1315189-9f4e-4654-bcef-b53029940255","html_url":"https://github.com/mlr-org/mlr3fselect","commit_stats":{"total_commits":567,"total_committers":6,"mean_commits":94.5,"dds":"0.40388007054673725","last_synced_commit":"703fdba27ed2721f8cabae7c4aec36043a87b1ca"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/mlr-org/mlr3fselect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlr-org","download_url":"https://codeload.github.com/mlr-org/mlr3fselect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fselect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274249912,"owners_count":25249391,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["evolutionary-algorithms","exhaustive-search","feature-selection","machine-learning","mlr3","optimization","r","r-package","random-search","recursive-feature-elimination","sequential-feature-selection"],"created_at":"2024-11-06T17:18:55.808Z","updated_at":"2025-09-09T05:37:55.814Z","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\n---\n\n```{r, include = FALSE}\nlgr::get_logger(\"mlr3\")$set_threshold(\"warn\")\nlgr::get_logger(\"bbotk\")$set_threshold(\"warn\")\nset.seed(0)\noptions(\n  datatable.print.nrows = 10,\n  datatable.print.class = FALSE,\n  datatable.print.keys = FALSE,\n  datatable.print.trunc.cols = TRUE,\n  width = 100)\n# mute load messages\nlibrary(\"mlr3fselect\")\n```\n\n# mlr3fselect \u003cimg src=\"man/figures/logo.png\" align=\"right\" width = \"120\" /\u003e\n\nPackage website: [release](https://mlr3fselect.mlr-org.com/) | [dev](https://mlr3fselect.mlr-org.com/dev/)\n\n\u003c!-- badges: start --\u003e\n[![r-cmd-check](https://github.com/mlr-org/mlr3fselect/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/mlr-org/mlr3fselect/actions/workflows/r-cmd-check.yml)\n[![CRAN Status](https://www.r-pkg.org/badges/version/mlr3fselect)](https://cran.r-project.org/package=mlr3fselect)\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*mlr3fselect* is the feature selection package of the [mlr3](https://mlr-org.com/) ecosystem.\nIt selects the optimal feature set for any mlr3 [learner](https://github.com/mlr-org/mlr3learners).\nThe package works with several optimization algorithms e.g. Random Search, Recursive Feature Elimination, and Genetic Search.\nMoreover, it can automatically optimize learners and estimate the performance of optimized feature sets with [nested resampling](https://mlr3book.mlr-org.com/chapters/chapter6/feature_selection.html#sec-autofselect).\nThe package is built on the optimization framework [bbotk](https://github.com/mlr-org/bbotk).\n\n## Resources\n\nThere are several section about feature selection in the [mlr3book](https://mlr3book.mlr-org.com).\n\n* Getting started with [wrapper feature selection](https://mlr3book.mlr-org.com/chapters/chapter6/feature_selection.html#sec-fs-wrapper).\n* Do a [sequential forward selection](https://mlr3book.mlr-org.com/chapters/chapter6/feature_selection.html#sec-fs-wrapper-example) Palmer Penguins data set.\n* Optimize [multiple performance measures](https://mlr3book.mlr-org.com/chapters/chapter6/feature_selection.html#sec-multicrit-featsel).\n* Estimate Model Performance with [nested resampling](https://mlr3book.mlr-org.com/chapters/chapter6/feature_selection.html#sec-autofselect).\n\nThe [gallery](https://mlr-org.com/gallery.html) features a collection of case studies and demos about optimization.\n\n* Utilize the built-in feature importance of models with [Recursive Feature Elimination](https://mlr-org.com/gallery/optimization/2023-02-07-recursive-feature-elimination/).\n* Run a feature selection with [Shadow Variable Search](https://mlr-org.com/gallery/optimization/2023-02-01-shadow-variable-search/).\n\nThe [cheatsheet](https://cheatsheets.mlr-org.com/mlr3fselect.pdf) summarizes the most important functions of mlr3fselect.\n\n## Installation\n\nInstall the last release from CRAN:\n\n```{r eval = FALSE}\ninstall.packages(\"mlr3fselect\")\n```\n\nInstall the development version from GitHub:\n\n```{r eval = FALSE}\nremotes::install_github(\"mlr-org/mlr3fselect\")\n```\n\n## Example\n\nWe run a feature selection for a support vector machine on the [Spam](https://mlr3.mlr-org.com/reference/mlr_tasks_spam.html) data set.\n\n```{r}\nlibrary(\"mlr3verse\")\n\ntsk(\"spam\")\n```\n\nWe construct an instance with the `fsi()` function.\nThe instance describes the optimization problem.\n\n```{r}\ninstance = fsi(\n  task = tsk(\"spam\"),\n  learner = lrn(\"classif.svm\", type = \"C-classification\"),\n  resampling = rsmp(\"cv\", folds = 3),\n  measures = msr(\"classif.ce\"),\n  terminator = trm(\"evals\", n_evals = 20)\n)\ninstance\n```\n\nWe select a simple random search as the optimization algorithm.\n\n```{r}\nfselector = fs(\"random_search\", batch_size = 5)\nfselector\n```\n\nTo start the feature selection, we simply pass the instance to the fselector.\n\n```{r, results='hide'}\nfselector$optimize(instance)\n```\n\nThe fselector writes the best hyperparameter configuration to the instance.\n\n```{r}\ninstance$result_feature_set\n```\n\nAnd the corresponding measured performance.\n\n```{r}\ninstance$result_y\n```\n\nThe archive contains all evaluated hyperparameter configurations.\n\n```{r}\nas.data.table(instance$archive)\n```\n\nWe fit a final model with the optimized feature set to make predictions on new data.\n\n```{r}\ntask = tsk(\"spam\")\nlearner = lrn(\"classif.svm\", type = \"C-classification\")\n\ntask$select(instance$result_feature_set)\nlearner$train(task)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlr-org%2Fmlr3fselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlr-org%2Fmlr3fselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlr-org%2Fmlr3fselect/lists"}