# \donttest{
if (requireNamespace("mlr3")) {
library(mlr3)
library(mlr3fselect)
set.seed (42)
efsr = ensemble_fselect(
fselector = fs("random_search"),
task = tsk("sonar"),
learners = lrns(c("classif.rpart", "classif.featureless")),
init_resampling = rsmp("subsampling", repeats = 5),
inner_resampling = rsmp("cv", folds = 3),
inner_measure = msr("classif.ce"),
measure = msr("classif.acc"),
terminator = trm("evals", n_evals = 5)
)
# Pareto front (default, stepwise)
autoplot(efsr)
# Pareto front (estimated)
autoplot(efsr, pareto_front = "estimated")
# Performance
autoplot(efsr, type = "performance")
# Number of features
autoplot(efsr, type = "n_features")
# stability
autoplot(efsr, type = "stability")
# use inner measure
efsr$set_active_measure("inner")
# Pareto front uses now the classification error
autoplot(efsr)
}
# }
Run the code above in your browser using DataLab