Package website: release | dev
This package provides feature selection for mlr3. It offers various feature selection wrappers, e.g. random search and sequential feature selection and different termination criteria can be set and combined.’AutoFSelect’ provides a convenient way to perform nested resampling in combination with ‘mlr3’. The package is build on bbotk which provides a common framework for optimization. For feature filters and embedded methods, see mlr3filters
- mlr3book chapter
- mlr3gallery post
- cheatsheet
Install the last release from CRAN:
install.packages("mlr3fselect")
Install the development version from GitHub:
remotes::install_github("mlr-org/mlr3fselect")
library("mlr3")
library("mlr3fselect")
task = tsk("pima")
learner = lrn("classif.rpart")
resampling = rsmp("holdout")
measure = msr("classif.ce")
# define termination criterion
terminator = trm("evals", n_evals = 20)
# create fselect instance
instance = FSelectInstanceSingleCrit$new(
task = task,
learner = learner,
resampling = resampling,
measure = measure,
terminator = terminator)
# load fselector
fselector = fs("random_search")
# trigger optimization
fselector$optimize(instance)
## age glucose insulin mass pedigree pregnant pressure triceps
## 1: TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE
## features classif.ce
## 1: age,glucose,insulin,mass,pedigree,triceps 0.1757812