FSelectorGeneticSearch class that implements an Genetic Search. Calls genalg::rbga.bin() from package genalg.

Dictionary

This FSelector can be instantiated via the dictionary mlr_fselectors or with the associated sugar function fs():

mlr_fselectors$get("genetic_search")
fs("genetic_search")

Parameters

suggestions

list()

popSize

integer(1)

mutationChance

numeric(1)

elitism

integer(1)

zeroToOneRatio

integer(1)

iters

integer(1)

For the meaning of the control parameters, see genalg::rbga.bin(). genalg::rbga.bin() internally terminates after iters iteration. We set ìters = 100000 to allow the termination via our terminators. If more iterations are needed, set ìters to a higher value in the parameter set.

Super class

mlr3fselect::FSelector -> FSelectorGeneticSearch

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage

FSelectorGeneticSearch$new()


Method clone()

The objects of this class are cloneable with this method.

Usage

FSelectorGeneticSearch$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

library(mlr3) terminator = trm("evals", n_evals = 5) instance = FSelectInstanceSingleCrit$new( task = tsk("iris"), learner = lrn("classif.rpart"), resampling = rsmp("holdout"), measure = msr("classif.ce"), terminator = terminator ) fselector = fs("genetic_search", popSize = 10L) # \donttest{ # Modifies the instance by reference fselector$optimize(instance)
#> Petal.Length Petal.Width Sepal.Length Sepal.Width features #> 1: TRUE TRUE FALSE FALSE Petal.Length,Petal.Width #> x_domain classif.ce #> 1: <list[4]> 0.08
# Returns best scoring evaluation instance$result
#> Petal.Length Petal.Width Sepal.Length Sepal.Width features #> 1: TRUE TRUE FALSE FALSE Petal.Length,Petal.Width #> x_domain classif.ce #> 1: <list[4]> 0.08
# Allows access of data.table of full path of all evaluations as.data.table(instance$archive)# }
#> Petal.Length Petal.Width Sepal.Length Sepal.Width classif.ce #> 1: TRUE TRUE FALSE FALSE 0.08 #> 2: FALSE TRUE FALSE FALSE 0.08 #> 3: FALSE TRUE FALSE FALSE 0.08 #> 4: FALSE FALSE TRUE FALSE 0.22 #> 5: FALSE TRUE FALSE FALSE 0.08 #> uhash timestamp batch_nr #> 1: be0b1bed-d7f9-4a8c-ab02-552466f348c5 2021-01-24 15:33:42 1 #> 2: 33090ebc-3ac3-47ed-be31-ac2c6d1c6d3a 2021-01-24 15:33:42 2 #> 3: 7f31d6ce-04bb-4866-aa94-ac543ac793b6 2021-01-24 15:33:42 3 #> 4: 1958f705-903d-4a55-b72d-e5bb702c52ed 2021-01-24 15:33:43 4 #> 5: da796fa2-4354-44d7-9d15-2c7fb614e31a 2021-01-24 15:33:43 5 #> x_domain_Petal.Length x_domain_Petal.Width x_domain_Sepal.Length #> 1: TRUE TRUE FALSE #> 2: FALSE TRUE FALSE #> 3: FALSE TRUE FALSE #> 4: FALSE FALSE TRUE #> 5: FALSE TRUE FALSE #> x_domain_Sepal.Width #> 1: FALSE #> 2: FALSE #> 3: FALSE #> 4: FALSE #> 5: FALSE