Skip to content

Commit

Permalink
refactor: make min.bucket and min.node.size a p_uty for classif.range…
Browse files Browse the repository at this point in the history
…r to allow vector values
  • Loading branch information
jemus42 committed Nov 8, 2024
1 parent a094329 commit e8c6344
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions R/LearnerClassifRanger.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ LearnerClassifRanger = R6Class("LearnerClassifRanger",
importance = p_fct(c("none", "impurity", "impurity_corrected", "permutation"), tags = "train"),
keep.inbag = p_lgl(default = FALSE, tags = "train"),
max.depth = p_int(default = NULL, lower = 1L, special_vals = list(NULL), tags = "train"),
min.bucket = p_int(1L, default = 1L, tags = "train"),
min.node.size = p_int(1L, default = NULL, special_vals = list(NULL), tags = "train"),
min.bucket = p_uty(default = 1L, tags = "train",
custom_check = function(x) {
if (checkmate::test_integerish(x)) return(TRUE)
"Must be integer of length 1 or greater"
}),
min.node.size = p_uty(default = NULL, special_vals = list(NULL), tags = "train",
custom_check = function(x) {
if (checkmate::test_integerish(x, null.ok = TRUE)) return(TRUE)
"Must be integer of length 1 or greater"
}),
mtry = p_int(lower = 1L, special_vals = list(NULL), tags = "train"),
mtry.ratio = p_dbl(lower = 0, upper = 1, tags = "train"),
na.action = p_fct(c("na.learn", "na.omit", "na.fail"), default = "na.learn", tags = "train"),
Expand Down
4 changes: 2 additions & 2 deletions man/mlr_learners_classif.ranger.Rd

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

0 comments on commit e8c6344

Please sign in to comment.