Skip to content

Commit

Permalink
feat: allow callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Apr 10, 2024
1 parent 2b724ae commit 2e05bd3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions R/ensemble_fselect.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
)
})

Expand Down

0 comments on commit 2e05bd3

Please sign in to comment.