Open be-marc opened 1 day ago
callback = callback_workhorse( id = "mlr3.selected_features", on_workhorse_before_result = function(callback, context) { context$env$learner$state$selected_features = setdiff(context$env$learner$model$frame$var, "<leaf>") } ) learner = lrn("classif.rpart") task = tsk("iris") resampling = rsmp("cv", folds = 3) rr = resample(task, learner, resampling, callbacks = callback) rr$learners[[1]]$state$selected_features