Skip to content

Commit

Permalink
fix: add missing predict parameters to regr.lm (#272)
Browse files Browse the repository at this point in the history
* fix: add missing predict parameters to regr.lm

* fix: param set

* fix: xgboost parameter
  • Loading branch information
be-marc authored Jul 26, 2023
1 parent 2c278e7 commit 66f2fc4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion R/LearnerClassifXgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ LearnerClassifXgboost = R6Class("LearnerClassifXgboost",
colsample_bylevel = p_dbl(0, 1, default = 1, tags = "train"),
colsample_bynode = p_dbl(0, 1, default = 1, tags = "train"),
colsample_bytree = p_dbl(0, 1, default = 1, tags = c("train", "control")),
device = p_uty(default = "cpu", tags = "train"),
disable_default_eval_metric = p_lgl(default = FALSE, tags = "train"),
early_stopping_rounds = p_int(1L, default = NULL, special_vals = list(NULL), tags = "train"),
early_stopping_set = p_fct(c("none", "train", "test"), default = "none", tags = "train"),
Expand Down Expand Up @@ -114,7 +115,6 @@ LearnerClassifXgboost = R6Class("LearnerClassifXgboost",
one_drop = p_lgl(default = FALSE, tags = "train"),
outputmargin = p_lgl(default = FALSE, tags = "predict"),
predcontrib = p_lgl(default = FALSE, tags = "predict"),
predictor = p_fct(c("cpu_predictor", "gpu_predictor"), default = "cpu_predictor", tags = "train"),
predinteraction = p_lgl(default = FALSE, tags = "predict"),
predleaf = p_lgl(default = FALSE, tags = "predict"),
print_every_n = p_int(1L, default = 1L, tags = "train"),
Expand Down
25 changes: 14 additions & 11 deletions R/LearnerRegrLM.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ LearnerRegrLM = R6Class("LearnerRegrLM",
#' Creates a new instance of this [R6][R6::R6Class] class.
initialize = function() {
ps = ps(
df = p_dbl(default = Inf, tags = "predict"),
interval = p_fct(c("none", "confidence", "prediction"), tags = "predict"),
level = p_dbl(default = 0.95, tags = "predict"),
model = p_lgl(default = TRUE, tags = "train"),
offset = p_lgl(tags = "train"),
pred.var = p_uty(tags = "predict"),
qr = p_lgl(default = TRUE, tags = "train"),
scale = p_dbl(default = NULL, special_vals = list(NULL), tags = "predict"),
singular.ok = p_lgl(default = TRUE, tags = "train"),
x = p_lgl(default = FALSE, tags = "train"),
y = p_lgl(default = FALSE, tags = "train")
df = p_dbl(default = Inf, tags = "predict"),
interval = p_fct(c("none", "confidence", "prediction"), tags = "predict"),
level = p_dbl(default = 0.95, tags = "predict"),
model = p_lgl(default = TRUE, tags = "train"),
offset = p_lgl(tags = "train"),
pred.var = p_uty(tags = "predict"),
qr = p_lgl(default = TRUE, tags = "train"),
scale = p_dbl(default = NULL, special_vals = list(NULL), tags = "predict"),
singular.ok = p_lgl(default = TRUE, tags = "train"),
x = p_lgl(default = FALSE, tags = "train"),
y = p_lgl(default = FALSE, tags = "train"),
rankdeficient = p_fct(c("warnif", "simple", "non-estim", "NA", "NAwarn"), tags = "predict"),
tol = p_dbl(default = 1e-07, tags = "predict"),
verbose = p_lgl(default = FALSE, tags = "predict")
)

super$initialize(
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerRegrXgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ LearnerRegrXgboost = R6Class("LearnerRegrXgboost",
colsample_bylevel = p_dbl(0, 1, default = 1, tags = "train"),
colsample_bynode = p_dbl(0, 1, default = 1, tags = "train"),
colsample_bytree = p_dbl(0, 1, default = 1, tags = "train"),
device = p_uty(default = "cpu", tags = "train"),
disable_default_eval_metric = p_lgl(default = FALSE, tags = "train"),
early_stopping_rounds = p_int(1L, default = NULL, special_vals = list(NULL), tags = "train"),
early_stopping_set = p_fct(c("none", "train", "test"), default = "none", tags = "train"),
Expand Down Expand Up @@ -89,7 +90,6 @@ LearnerRegrXgboost = R6Class("LearnerRegrXgboost",
one_drop = p_lgl(default = FALSE, tags = "train"),
outputmargin = p_lgl(default = FALSE, tags = "predict"),
predcontrib = p_lgl(default = FALSE, tags = "predict"),
predictor = p_fct(c("cpu_predictor", "gpu_predictor"), default = "cpu_predictor", tags = "train"),
predinteraction = p_lgl(default = FALSE, tags = "predict"),
predleaf = p_lgl(default = FALSE, tags = "predict"),
print_every_n = p_int(1L, default = 1L, tags = "train"),
Expand Down

0 comments on commit 66f2fc4

Please sign in to comment.