# NOT RUN {
library(mlr3)
library(data.table)
# Objects required to define the objective function
task = tsk("iris")
measure = msr("classif.ce")
learner = lrn("classif.rpart")
resampling = rsmp("cv")
# Create instance
terminator = trm("evals", n_evals = 8)
inst = FSelectInstanceSingleCrit$new(
task = task,
learner = learner,
resampling = resampling,
measure = measure,
terminator = terminator
)
# Try some feature subsets
xdt = data.table(
Petal.Length = c(TRUE, FALSE),
Petal.Width = c(FALSE, TRUE),
Sepal.Length = c(TRUE, FALSE),
Sepal.Width = c(FALSE, TRUE)
)
inst$eval_batch(xdt)
# Get archive data
inst$archive$data()
# }
Run the code above in your browser using DataLab