diff --git a/R/PipeOpVtreat.R b/R/PipeOpVtreat.R index 0f3e3f0de..1fbf36085 100644 --- a/R/PipeOpVtreat.R +++ b/R/PipeOpVtreat.R @@ -140,26 +140,55 @@ PipeOpVtreat = R6Class("PipeOpVtreat", rareSig = p_dbl(lower = 0, upper = 1, special_vals = list(NULL), tags = c("train", "regression", "classification", "multinomial")), # default NULL for regression, classification, 1 for multinomial collarProb = p_dbl(lower = 0, upper = 1, default = 0, tags = c("train", "regression", "classification", "multinomial"), depends = quote(doCollar == TRUE)), doCollar = p_lgl(default = FALSE, tags = c("train", "regression", "classification", "multinomial")), - codeRestriction = p_uty(default = NULL, custom_check = function(x) checkmate::check_character(x, any.missing = FALSE, null.ok = TRUE), - tags = c("train", "regression", "classification", "multinomial")), - customCoders = p_uty(default = NULL, custom_check = function(x) checkmate::check_list(x, null.ok = TRUE), tags = c("train", "regression", "classification", "multinomial")), - splitFunction = p_uty(default = NULL, custom_check = function(x) checkmate::check_function(x, args = c("nSplits", "nRows", "dframe", "y"), null.ok = TRUE), - tags = c("train", "regression", "classification", "multinomial")), + codeRestriction = p_uty( + default = NULL, + custom_check = crate(function(x) checkmate::check_character(x, any.missing = FALSE, null.ok = TRUE), .parent = topenv()), + tags = c("train", "regression", "classification", "multinomial") + ), + customCoders = p_uty( + default = NULL, + custom_check = crate(function(x) checkmate::check_list(x, null.ok = TRUE), .parent = topenv()), + tags = c("train", "regression", "classification", "multinomial") + ), + splitFunction = p_uty( + default = NULL, + custom_check = crate(function(x) checkmate::check_function(x, args = c("nSplits", "nRows", "dframe", "y"), null.ok = TRUE), .parent = topenv()), + tags = c("train", "regression", "classification", "multinomial") + ), ncross = p_int(lower = 2L, upper = Inf, default = 3L, tags = c("train", "regression", "classification", "multinomial")), forceSplit = p_lgl(default = FALSE, tags = c("train", "regression", "classification", "multinomial")), catScaling = p_lgl(tags = c("train", "regression", "classification", "multinomial")), # default TRUE for regression, classification, FALSE for multinomial verbose = p_lgl(default = FALSE, tags = c("train", "regression", "classification", "multinomial")), use_paralell = p_lgl(default = TRUE, tags = c("train", "regression", "classification", "multinomial")), - missingness_imputation = p_uty(default = NULL, custom_check = function(x) checkmate::check_function(x, args = c("values", "weights"), null.ok = TRUE), - tags = c("train", "regression", "classification", "multinomial")), + missingness_imputation = p_uty( + default = NULL, + custom_check = crate(function(x) checkmate::check_function(x, args = c("values", "weights"), null.ok = TRUE), .parent = topenv()), + tags = c("train", "regression", "classification", "multinomial") + ), pruneSig = p_dbl(lower = 0, upper = 1, special_vals = list(NULL), default = NULL, tags = c("train", "regression", "classification")), scale = p_lgl(default = FALSE, tags = c("train", "regression", "classification", "multinomial")), - varRestriction = p_uty(default = NULL, custom_check = function(x) checkmate::check_list(x, null.ok = TRUE), tags = c("train", "regression", "classification")), - trackedValues = p_uty(default = NULL, custom_check = function(x) checkmate::check_list(x, null.ok = TRUE), tags = c("train", "regression", "classification")), + varRestriction = p_uty( + default = NULL, + custom_check = crate(function(x) checkmate::check_list(x, null.ok = TRUE), .parent = topenv()), + tags = c("train", "regression", "classification") + ), + trackedValues = p_uty( + default = NULL, + custom_check = crate(function(x) checkmate::check_list(x, null.ok = TRUE), .parent = topenv()), + tags = c("train", "regression", "classification") + ), # NOTE: check_for_duplicate_frames not needed - y_dependent_treatments = p_uty(default = "catB", custom_check = function(x) checkmate::check_character(x, any.missing = FALSE), tags = c("train", "multinomial")), + y_dependent_treatments = p_uty( + default = "catB", + custom_check = crate(function(x) checkmate::check_character(x, any.missing = FALSE), .parent = topenv()), + tags = c("train", "multinomial") + ), # NOTE: imputation_map is also in multinomial_parameters(); this is redundant so only include it here - imputation_map = p_uty(default = NULL, custom_check = function(x) checkmate::check_list(x, null.ok = TRUE), tags = c("train", "predict")) + imputation_map = p_uty( + default = NULL, + custom_check = crate(function(x) checkmate::check_list(x, null.ok = TRUE), .parent = topenv()), + tags = c("train", "predict") + ) # NOTE: parallelCluster missing intentionally and will be set to NULL ) ps$values = list(recommended = TRUE, cols_to_copy = selector_none())