Skip to content

Commit

Permalink
fix: quote depends
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Mar 13, 2024
1 parent a6f1825 commit bcdea14
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 57 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ vignettes/learners/
^gfortran.*
^revdep$
^cran-comments\.md$
^CRAN-SUBMISSION$
2 changes: 1 addition & 1 deletion R/LearnerClassifCVGlmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LearnerClassifCVGlmnet = R6Class("LearnerClassifCVGlmnet",
exmx = p_dbl(default = 250.0, tags = "train"),
fdev = p_dbl(0, 1, default = 1.0e-5, tags = "train"),
foldid = p_uty(default = NULL, tags = "train"),
gamma = p_uty(tags = "train", depends = relax == TRUE),
gamma = p_uty(tags = "train", depends = quote(relax == TRUE)),
grouped = p_lgl(default = TRUE, tags = "train"),
intercept = p_lgl(default = TRUE, tags = "train"),
keep = p_lgl(default = FALSE, tags = "train"),
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerClassifGlmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ LearnerClassifGlmnet = R6Class("LearnerClassifGlmnet",
exclude = p_int(1L, tags = "train"),
exmx = p_dbl(default = 250.0, tags = "train"),
fdev = p_dbl(0, 1, default = 1.0e-5, tags = "train"),
gamma = p_dbl(default = 1, tags = "predict", depends = relax == TRUE),
gamma = p_dbl(default = 1, tags = "predict", depends = quote(relax == TRUE)),
intercept = p_lgl(default = TRUE, tags = "train"),
lambda = p_uty(tags = "train"),
lambda.min.ratio = p_dbl(0, 1, tags = "train"),
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerClassifLDA.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ LearnerClassifLDA = R6Class("LearnerClassifLDA",
ps = ps(
dimen = p_uty(tags = "predict"),
method = p_fct(c("moment", "mle", "mve", "t"), default = "moment", tags = "train"),
nu = p_int(tags = "train", depends = method == "t"),
nu = p_int(tags = "train", depends = quote(method == "t")),
predict.method = p_fct(c("plug-in", "predictive", "debiased"), default = "plug-in", tags = "predict"),
predict.prior = p_uty(tags = "predict"),
prior = p_uty(tags = "train"),
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerClassifQDA.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LearnerClassifQDA = R6Class("LearnerClassifQDA",
initialize = function() {
ps = ps(
method = p_fct(c("moment", "mle", "mve", "t"), default = "moment", tags = "train"),
nu = p_int(tags = "train", depends = method == "t"),
nu = p_int(tags = "train", depends = quote(method == "t")),
predict.method = p_fct(c("plug-in", "predictive", "debiased"), default = "plug-in", tags = "predict"),
predict.prior = p_uty(tags = "predict"),
prior = p_uty(tags = "train")
Expand Down
4 changes: 2 additions & 2 deletions R/LearnerClassifRanger.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ LearnerClassifRanger = R6Class("LearnerClassifRanger",
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"),
num.random.splits = p_int(1L, default = 1L, tags = "train", depends = splitrule == "extratrees"),
num.random.splits = p_int(1L, default = 1L, tags = "train", depends = quote(splitrule == "extratrees")),
node.stats = p_lgl(default = FALSE, 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")),
Expand All @@ -60,7 +60,7 @@ LearnerClassifRanger = R6Class("LearnerClassifRanger",
respect.unordered.factors = p_fct(c("ignore", "order", "partition"), default = "ignore", tags = "train"),
sample.fraction = p_dbl(0L, 1L, tags = "train"),
save.memory = p_lgl(default = FALSE, tags = "train"),
scale.permutation.importance = p_lgl(default = FALSE, tags = "train", depends = importance == "permutation"),
scale.permutation.importance = p_lgl(default = FALSE, tags = "train", depends = quote(importance == "permutation")),
se.method = p_fct(c("jack", "infjack"), default = "infjack", tags = "predict"),
seed = p_int(default = NULL, special_vals = list(NULL), tags = c("train", "predict")),
split.select.weights = p_uty(default = NULL, tags = "train"),
Expand Down
10 changes: 5 additions & 5 deletions R/LearnerClassifSVM.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ LearnerClassifSVM = R6Class("LearnerClassifSVM",
ps = ps(
cachesize = p_dbl(default = 40L, tags = "train"),
class.weights = p_uty(default = NULL, tags = "train"),
coef0 = p_dbl(default = 0, tags = "train", depends = kernel %in% c("polynomial", "sigmoid")),
cost = p_dbl(0, default = 1, tags = "train", depends = type == "C-classification"),
coef0 = p_dbl(default = 0, tags = "train", depends = quote(kernel %in% c("polynomial", "sigmoid"))),
cost = p_dbl(0, default = 1, tags = "train", depends = quote(type == "C-classification")),
cross = p_int(0L, default = 0L, tags = "train"),
decision.values = p_lgl(default = FALSE, tags = "predict"),
degree = p_int(1L, default = 3L, tags = "train", depends = kernel == "polynomial"),
degree = p_int(1L, default = 3L, tags = "train", depends = quote(kernel == "polynomial")),
epsilon = p_dbl(0, default = 0.1, tags = "train"),
fitted = p_lgl(default = TRUE, tags = "train"),
gamma = p_dbl(0, tags = "train", depends = kernel %in% c("polynomial", "radial", "sigmoid")),
gamma = p_dbl(0, tags = "train", depends = quote(kernel %in% c("polynomial", "radial", "sigmoid"))),
kernel = p_fct(c("linear", "polynomial", "radial", "sigmoid"), default = "radial", tags = "train"),
nu = p_dbl(default = 0.5, tags = "train", depends = type == "nu-classification"),
nu = p_dbl(default = 0.5, tags = "train", depends = quote(type == "nu-classification")),
scale = p_uty(default = TRUE, tags = "train"),
shrinking = p_lgl(default = TRUE, tags = "train"),
tolerance = p_dbl(0, default = 0.001, tags = "train"),
Expand Down
30 changes: 15 additions & 15 deletions R/LearnerClassifXgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,51 +92,51 @@ LearnerClassifXgboost = R6Class("LearnerClassifXgboost",
early_stopping_set = p_fct(c("none", "train", "test"), default = "none", tags = "train"),
eta = p_dbl(0, 1, default = 0.3, tags = c("train", "control")),
eval_metric = p_uty(tags = "train"),
feature_selector = p_fct(c("cyclic", "shuffle", "random", "greedy", "thrifty"), default = "cyclic", tags = "train", depends = booster == "gblinear"),
feature_selector = p_fct(c("cyclic", "shuffle", "random", "greedy", "thrifty"), default = "cyclic", tags = "train", depends = quote(booster == "gblinear")),
feval = p_uty(default = NULL, tags = "train"),
gamma = p_dbl(0, default = 0, tags = c("train", "control")),
grow_policy = p_fct(c("depthwise", "lossguide"), default = "depthwise", tags = "train", depends = tree_method == "hist"),
grow_policy = p_fct(c("depthwise", "lossguide"), default = "depthwise", tags = "train", depends = quote(tree_method == "hist")),
interaction_constraints = p_uty(tags = "train"),
iterationrange = p_uty(tags = "predict"),
lambda = p_dbl(0, default = 1, tags = "train"),
lambda_bias = p_dbl(0, default = 0, tags = "train", depends = booster == "gblinear"),
max_bin = p_int(2L, default = 256L, tags = "train", depends = tree_method == "hist"),
lambda_bias = p_dbl(0, default = 0, tags = "train", depends = quote(booster == "gblinear")),
max_bin = p_int(2L, default = 256L, tags = "train", depends = quote(tree_method == "hist")),
max_delta_step = p_dbl(0, default = 0, tags = "train"),
max_depth = p_int(0L, default = 6L, tags = c("train", "control")),
max_leaves = p_int(0L, default = 0L, tags = "train", depends = grow_policy == "lossguide"),
max_leaves = p_int(0L, default = 0L, tags = "train", depends = quote(grow_policy == "lossguide")),
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 = 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", depends = booster == "dart"),
normalize_type = p_fct(c("tree", "forest"), default = "tree", tags = "train", depends = quote(booster == "dart")),
nrounds = p_int(1L, tags = c("train", "hotstart")),
nthread = p_int(1L, default = 1L, tags = c("train", "control", "threads")),
ntreelimit = p_int(1L, default = NULL, special_vals = list(NULL), tags = "predict"),
num_parallel_tree = p_int(1L, default = 1L, tags = c("train", "control")),
objective = p_uty(default = "binary:logistic", tags = c("train", "predict", "control")),
one_drop = p_lgl(default = FALSE, tags = "train", depends = booster == "dart"),
one_drop = p_lgl(default = FALSE, tags = "train", depends = quote(booster == "dart")),
outputmargin = p_lgl(default = FALSE, tags = "predict"),
predcontrib = p_lgl(default = FALSE, tags = "predict"),
predinteraction = p_lgl(default = FALSE, tags = "predict"),
predleaf = p_lgl(default = FALSE, tags = "predict"),
print_every_n = p_int(1L, default = 1L, tags = "train", depends = verbose == 1L),
print_every_n = p_int(1L, default = 1L, tags = "train", depends = quote(verbose == 1L)),
process_type = p_fct(c("default", "update"), default = "default", tags = "train"),
rate_drop = p_dbl(0, 1, default = 0, tags = "train", depends = booster == "dart"),
rate_drop = p_dbl(0, 1, default = 0, tags = "train", depends = quote(booster == "dart")),
refresh_leaf = p_lgl(default = TRUE, tags = "train"),
reshape = p_lgl(default = FALSE, tags = "predict"),
seed_per_iteration = p_lgl(default = FALSE, tags = "train"),
sampling_method = p_fct(c("uniform", "gradient_based"), default = "uniform", tags = "train", depends = booster == "gbtree"),
sample_type = p_fct(c("uniform", "weighted"), default = "uniform", tags = "train", depends = booster == "dart"),
sampling_method = p_fct(c("uniform", "gradient_based"), default = "uniform", tags = "train", depends = quote(booster == "gbtree")),
sample_type = p_fct(c("uniform", "weighted"), default = "uniform", tags = "train", depends = quote(booster == "dart")),
save_name = p_uty(default = NULL, tags = "train"),
save_period = p_int(0, default = NULL, special_vals = list(NULL), tags = "train"),
scale_pos_weight = p_dbl(default = 1, tags = "train"),
skip_drop = p_dbl(0, 1, default = 0, tags = "train", depends = booster == "dart"),
skip_drop = p_dbl(0, 1, default = 0, tags = "train", depends = quote(booster == "dart")),
strict_shape = p_lgl(default = FALSE, tags = "predict"),
subsample = p_dbl(0, 1, default = 1, tags = c("train", "control")),
top_k = p_int(0, default = 0, tags = "train", depends = feature_selector %in% c("greedy", "thrifty") && booster == "gblinear"),
top_k = p_int(0, default = 0, tags = "train", depends = quote(feature_selector %in% c("greedy", "thrifty") && booster == "gblinear")),
training = p_lgl(default = FALSE, tags = "predict"),
tree_method = p_fct(c("auto", "exact", "approx", "hist", "gpu_hist"), default = "auto", tags = "train", depends = booster %in% c("gbtree", "dart")),
tweedie_variance_power = p_dbl(1, 2, default = 1.5, tags = "train", depends = objective == "reg:tweedie"),
tree_method = p_fct(c("auto", "exact", "approx", "hist", "gpu_hist"), default = "auto", tags = "train", depends = quote(booster %in% c("gbtree", "dart"))),
tweedie_variance_power = p_dbl(1, 2, default = 1.5, tags = "train", depends = quote(objective == "reg:tweedie")),
updater = p_uty(tags = "train"), # Default depends on the selected booster
verbose = p_int(0L, 2L, default = 1L, tags = "train"),
watchlist = p_uty(default = NULL, tags = "train"),
Expand Down
4 changes: 2 additions & 2 deletions R/LearnerRegrCVGlmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LearnerRegrCVGlmnet = R6Class("LearnerRegrCVGlmnet",
family = p_fct(c("gaussian", "poisson"), default = "gaussian", tags = "train"),
fdev = p_dbl(0, 1, default = 1.0e-5, tags = "train"),
foldid = p_uty(default = NULL, tags = "train"),
gamma = p_uty(tags = "train", depends = relax == TRUE),
gamma = p_uty(tags = "train", depends = quote(relax == TRUE)),
grouped = p_lgl(default = TRUE, tags = "train"),
intercept = p_lgl(default = TRUE, tags = "train"),
keep = p_lgl(default = FALSE, tags = "train"),
Expand All @@ -64,7 +64,7 @@ LearnerRegrCVGlmnet = R6Class("LearnerRegrCVGlmnet",
standardize.response = p_lgl(default = FALSE, tags = "train"),
thresh = p_dbl(0, default = 1e-07, tags = "train"),
trace.it = p_int(0, 1, default = 0, tags = "train"),
type.gaussian = p_fct(c("covariance", "naive"), tags = "train", depends = family == "gaussian"),
type.gaussian = p_fct(c("covariance", "naive"), tags = "train", depends = quote(family == "gaussian")),
type.logistic = p_fct(c("Newton", "modified.Newton"), tags = "train"),
type.measure = p_fct(c("deviance", "class", "auc", "mse", "mae"), default = "deviance", tags = "train"),
type.multinomial = p_fct(c("ungrouped", "grouped"), tags = "train"),
Expand Down
4 changes: 2 additions & 2 deletions R/LearnerRegrGlmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LearnerRegrGlmnet = R6Class("LearnerRegrGlmnet",
exmx = p_dbl(default = 250.0, tags = "train"),
family = p_fct(c("gaussian", "poisson"), default = "gaussian", tags = "train"),
fdev = p_dbl(0, 1, default = 1.0e-5, tags = "train"),
gamma = p_dbl(default = 1, tags = "train", depends = relax == TRUE),
gamma = p_dbl(default = 1, tags = "train", depends = quote(relax == TRUE)),
grouped = p_lgl(default = TRUE, tags = "train"),
intercept = p_lgl(default = TRUE, tags = "train"),
keep = p_lgl(default = FALSE, tags = "train"),
Expand All @@ -65,7 +65,7 @@ LearnerRegrGlmnet = R6Class("LearnerRegrGlmnet",
standardize.response = p_lgl(default = FALSE, tags = "train"),
thresh = p_dbl(0, default = 1e-07, tags = "train"),
trace.it = p_int(0, 1, default = 0, tags = "train"),
type.gaussian = p_fct(c("covariance", "naive"), tags = "train", depends = family == "gaussian"),
type.gaussian = p_fct(c("covariance", "naive"), tags = "train", depends = quote(family == "gaussian")),
type.logistic = p_fct(c("Newton", "modified.Newton"), tags = "train"),
type.multinomial = p_fct(c("ungrouped", "grouped"), tags = "train"),
upper.limits = p_uty(tags = "train")
Expand Down
4 changes: 2 additions & 2 deletions R/LearnerRegrKM.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ LearnerRegrKM = R6Class("LearnerRegrKM",
iso = p_lgl(default = FALSE, tags = "train"),
jitter = p_dbl(0, default = 0, tags = "predict"),
kernel = p_uty(default = NULL, tags = "train"),
knots = p_uty(default = NULL, tags = "train", depends = scaling == TRUE),
knots = p_uty(default = NULL, tags = "train", depends = quote(scaling == TRUE)),
light.return = p_lgl(default = FALSE, tags = "predict"),
lower = p_uty(default = NULL, tags = "train"),
multistart = p_int(default = 1, tags = "train", depends = optim.method == "BFGS"),
multistart = p_int(default = 1, tags = "train", depends = quote(optim.method == "BFGS")),
noise.var = p_uty(default = NULL, tags = "train"),
nugget = p_dbl(tags = "train"),
nugget.estim = p_lgl(default = FALSE, tags = "train"),
Expand Down
Loading

0 comments on commit bcdea14

Please sign in to comment.