Skip to content

Commit

Permalink
feat: add min.bucket parameter to ranger learner (#266)
Browse files Browse the repository at this point in the history
* feat: add min.bucket parameter to ranger learner

* chore: update news
  • Loading branch information
be-marc authored Apr 17, 2023
1 parent bedb629 commit 165b90b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# mlr3learners 0.5.6-9000

* Added formula argument to `nnet` learner and support feature type `"integer"`
* Added `min.bucket` parameter to `classif.ranger` and `regr.ranger`.

# mlr3learners 0.5.6

Expand Down
7 changes: 5 additions & 2 deletions R/LearnerClassifRanger.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ 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 = 0L, 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.prop = p_dbl(default = 0.1, tags = "train"),
minprop = p_dbl(default = 0.1, tags = "train"),
Expand Down Expand Up @@ -131,8 +132,10 @@ LearnerClassifRanger = R6Class("LearnerClassifRanger",
newdata = ordered_features(task, self)

prediction = invoke(predict,
self$model, data = newdata,
predict.type = "response", .args = pv)
self$model,
data = newdata,
predict.type = "response", .args = pv
)

if (self$predict_type == "response") {
list(response = prediction$predictions)
Expand Down
1 change: 1 addition & 0 deletions R/LearnerRegrRanger.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ LearnerRegrRanger = R6Class("LearnerRegrRanger",
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 = 0L, special_vals = list(NULL), tags = "train"),
min.bucket = p_int(1L, default = 1L, tags = "train"),
min.node.size = p_int(1L, default = 5L, special_vals = list(NULL), tags = "train"),
min.prop = p_dbl(default = 0.1, tags = "train"),
minprop = p_dbl(default = 0.1, tags = "train"),
Expand Down

0 comments on commit 165b90b

Please sign in to comment.