Skip to content

Commit

Permalink
fix: crate monotone_constraints custom check in xgboost (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc authored Nov 17, 2023
1 parent 2fd9c1a commit 5d5ecb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/LearnerClassifXgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ LearnerClassifXgboost = R6Class("LearnerClassifXgboost",
maximize = p_lgl(default = NULL, special_vals = list(NULL), tags = "train"),
min_child_weight = p_dbl(0, default = 1, tags = c("train", "control")),
missing = p_dbl(default = NA, tags = c("train", "predict"), special_vals = list(NA, NA_real_, NULL)),
monotone_constraints = p_uty(default = 0, tags = c("train", "control"), custom_check = function(x) { checkmate::check_integerish(x, lower = -1, upper = 1, any.missing = FALSE) }), # nolint
monotone_constraints = p_uty(default = 0, tags = c("train", "control"), custom_check = crate(function(x) { checkmate::check_integerish(x, lower = -1, upper = 1, any.missing = FALSE) })), # nolint
normalize_type = p_fct(c("tree", "forest"), default = "tree", tags = "train"),
nrounds = p_int(1L, tags = c("train", "hotstart")),
nthread = p_int(1L, default = 1L, tags = c("train", "control", "threads")),
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerRegrXgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ LearnerRegrXgboost = R6Class("LearnerRegrXgboost",
maximize = p_lgl(default = NULL, special_vals = list(NULL), tags = "train"),
min_child_weight = p_dbl(0, default = 1, tags = "train"),
missing = p_dbl(default = NA, tags = c("train", "predict"), special_vals = list(NA, NA_real_, NULL)),
monotone_constraints = p_uty(default = 0, tags = c("train", "control"), custom_check = function(x) { checkmate::check_integerish(x, lower = -1, upper = 1, any.missing = FALSE) }), # nolint
monotone_constraints = p_uty(default = 0, tags = c("train", "control"), custom_check = crate(function(x) { checkmate::check_integerish(x, lower = -1, upper = 1, any.missing = FALSE) })), # nolint
normalize_type = p_fct(c("tree", "forest"), default = "tree", tags = "train"),
nrounds = p_int(1L, tags = c("train", "hotstart")),
nthread = p_int(1L, default = 1L, tags = c("train", "threads")),
Expand Down

0 comments on commit 5d5ecb7

Please sign in to comment.