From 1a4d571cca8a866abe76224a34dbac6b672a3f2c Mon Sep 17 00:00:00 2001 From: Marc Becker <33069354+be-marc@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:20:14 +0100 Subject: [PATCH] fix: ranger parameters (#277) * fix: ignore time.interest parameter * feat: add node.stats parameter * fix: minprop --- R/LearnerClassifRanger.R | 2 +- R/LearnerRegrRanger.R | 2 +- inst/paramtest/test_paramtest_classif.ranger.R | 2 +- inst/paramtest/test_paramtest_regr.ranger.R | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/LearnerClassifRanger.R b/R/LearnerClassifRanger.R index d3416576..a292cfd9 100644 --- a/R/LearnerClassifRanger.R +++ b/R/LearnerClassifRanger.R @@ -46,10 +46,10 @@ LearnerClassifRanger = R6Class("LearnerClassifRanger", 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"), mtry = p_int(lower = 1L, special_vals = list(NULL), tags = "train"), mtry.ratio = p_dbl(lower = 0, upper = 1, tags = "train"), + node.stats = p_lgl(default = FALSE, tags = "train"), num.random.splits = p_int(1L, default = 1L, tags = "train"), num.threads = p_int(1L, default = 1L, tags = c("train", "predict", "threads")), num.trees = p_int(1L, default = 500L, tags = c("train", "predict", "hotstart")), diff --git a/R/LearnerRegrRanger.R b/R/LearnerRegrRanger.R index 867e1637..8462f183 100644 --- a/R/LearnerRegrRanger.R +++ b/R/LearnerRegrRanger.R @@ -35,10 +35,10 @@ LearnerRegrRanger = R6Class("LearnerRegrRanger", 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"), mtry = p_int(lower = 1L, special_vals = list(NULL), tags = "train"), mtry.ratio = p_dbl(lower = 0, upper = 1, tags = "train"), + node.stats = p_lgl(default = FALSE, tags = "train"), num.random.splits = p_int(1L, default = 1L, tags = "train"), num.threads = p_int(1L, default = 1L, tags = c("train", "predict", "threads")), num.trees = p_int(1L, default = 500L, tags = c("train", "predict", "hotstart")), diff --git a/inst/paramtest/test_paramtest_classif.ranger.R b/inst/paramtest/test_paramtest_classif.ranger.R index 07bd0372..878f3f4e 100644 --- a/inst/paramtest/test_paramtest_classif.ranger.R +++ b/inst/paramtest/test_paramtest_classif.ranger.R @@ -18,7 +18,7 @@ test_that("classif.ranger", { "status.variable.name", # handled via mlr3 "classification", # handled via mlr3 "mtry.ratio", # custom hyperpar - "min.prop" # renamed to minprop in upstream package + "time.interest" # survival only ) ParamTest = run_paramtest(learner, fun, exclude, tag = "train") diff --git a/inst/paramtest/test_paramtest_regr.ranger.R b/inst/paramtest/test_paramtest_regr.ranger.R index 4858c8d2..9af09cfa 100644 --- a/inst/paramtest/test_paramtest_regr.ranger.R +++ b/inst/paramtest/test_paramtest_regr.ranger.R @@ -17,7 +17,7 @@ test_that("regr.ranger", { "status.variable.name", # handled via mlr3 "classification", # handled via mlr3 "mtry.ratio", # custom hyperpar - "min.prop" # renamed to minprop in upstream package + "time.interest" # survival only ) ParamTest = run_paramtest(learner, fun, exclude, tag = "train")