Skip to content

Commit

Permalink
limit number of cores
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Nov 8, 2024
1 parent c2bfb6b commit 53e1df8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
11 changes: 9 additions & 2 deletions R/FilterBoruta.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
#' The order of selected features is random.
#' In combination with \CRANpkg{mlr3pipelines}, only the filter criterion `cutoff` makes sense.
#'
#' @section Initial parameter values:
#' - `num.threads`:
#' - Actual default: `NULL`, triggering auto-detection of the number of CPUs.
#' - Adjusted value: 1.
#' - Reason for change: Conflicting with parallelization via \CRANpkg{future}.
#'
#' @references
#' `r format_bib("kursa_2010")`
#'
Expand Down Expand Up @@ -43,10 +49,11 @@ FilterBoruta = R6Class("FilterBoruta",
doTrace = p_int(lower = 0, upper = 4, default = 0),
holdHistory = p_lgl(default = TRUE),
getImp = p_uty(),
keep = p_fct(levels = c("confirmed", "tentative"), default = "confirmed")
keep = p_fct(levels = c("confirmed", "tentative"), default = "confirmed"),
num.threads = p_int(lower = 1, default = 1)
)

param_set$set_values(keep = "confirmed")
param_set$set_values(keep = "confirmed", num.threads = 1)

super$initialize(
id = "boruta",
Expand Down
3 changes: 2 additions & 1 deletion man/mlr3filters-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions man/mlr_filters_boruta.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test_filter_regr.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ test_that("filters throw errors on missing values", {
})

test_that("Errors for unsupported features", {
skip_if("ames_housing" %nin% mlr_tasks$keys())
task = tsk("ames_housing")
skip_if("california_housing" %nin% mlr_tasks$keys())
task = tsk("california_housing")
filters = mlr_filters$mget(mlr_filters$keys())

# supported: numeric, integer
Expand Down

0 comments on commit 53e1df8

Please sign in to comment.