mlr-org / mlr3tuning

Hyperparameter optimization package of the mlr3 ecosystem
https://mlr3tuning.mlr-org.com/
GNU Lesser General Public License v3.0
52 stars 5 forks source link

Internal Tuning #420

Closed sebffischer closed 2 weeks ago

sebffischer commented 2 months ago
library(mlr3tuning)
library(mlr3learners)
library(mlr3pipelines)

# graph = ppl("robustify") %>>%
graph = ppl("robustify") %>>% lrn("classif.xgboost", alpha = to_tune(0, 1), nrounds = to_tune(upper = 1000L, internal = TRUE), early_stopping_rounds = 10L)

learner = as_learner(graph)

set_validate(learner, validate = "test")

at = auto_tuner(
  tuner = tnr("random_search"),
  learner = learner,
  resampling = rsmp("cv", folds = 3),
  measure = msr("classif.ce"),
  term_evals = 4
)

task = tsk("iris")

rr = resample(task, at, rsmp("cv", folds = 3L))