From 2e05bd3d85a0b730932ee5081445b510d38e826c Mon Sep 17 00:00:00 2001 From: be-marc Date: Wed, 10 Apr 2024 15:46:11 +0200 Subject: [PATCH] feat: allow callbacks --- R/ensemble_fselect.R | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/R/ensemble_fselect.R b/R/ensemble_fselect.R index e3597b77..644ea0b4 100644 --- a/R/ensemble_fselect.R +++ b/R/ensemble_fselect.R @@ -30,14 +30,10 @@ #' terminator = trm("evals", n_evals = 10) #' ) #' } -ensemble_fselect = function(fselector, task, learners, outer_resampling, inner_resampling, measure, terminator) { +ensemble_fselect = function(fselector, task, learners, outer_resampling, inner_resampling, measure, terminator, callbacks = list()) { assert_task(task) assert_learners(as_learners(learners), task = task) assert_resampling(outer_resampling) - assert_resampling(inner_resampling) - assert_measure(measure) - assert_fselector(fselector) - assert_terminator(terminator) # create fselector for each learner afss = map(learners, function(learner) { @@ -47,7 +43,8 @@ ensemble_fselect = function(fselector, task, learners, outer_resampling, inner_r resampling = inner_resampling, measure = measure, terminator = terminator, - store_models = TRUE + store_models = TRUE, + callbacks = callbacks ) })