README.md

mlr3fselect

Package website: release | dev

tic CRAN
Status StackOverflow Mattermost CodeFactor

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

Resources

Installation

Install the last release from CRAN:

install.packages("mlr3fselect")

Install the development version from GitHub:

remotes::install_github("mlr-org/mlr3fselect")

Example

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


Try the mlr3fselect package in your browser

Any scripts or data that you put into this service are public.

mlr3fselect documentation built on March 9, 2021, 5:06 p.m.