Skip to content
10 changes: 7 additions & 3 deletions R/RLearner_classif_mda.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ makeRLearner.classif.mda = function() {
makeIntegerLearnerParam(id = "dimension", lower = 1L),
makeNumericLearnerParam(id = "eps", default = .Machine$double.eps, lower = 0),
makeIntegerLearnerParam(id = "iter", default = 5L, lower = 1L),
makeDiscreteLearnerParam(id = "method", default = mda::polyreg,
values = list(polyreg = mda::polyreg, mars = mda::mars, bruto = mda::bruto, gen.ridge = mda::gen.ridge)),
# see helpers_mda.R for objects
makeUntypedLearnerParam(id = "method", default = function(...) mda::polyreg(...),
values = list(polyreg = function(...) mda::polyreg(...),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for an untyped Param you cannot set values.

mars = function(...) mda::mars(...),
bruto = function(...) mda::bruto(...),
gen.ridge = function(...) mda::gen.ridge(...))),
makeLogicalLearnerParam(id = "keep.fitted", default = TRUE),
makeLogicalLearnerParam(id = "trace", default = FALSE, tunable = FALSE),
makeDiscreteLearnerParam(id = "start.method", default = "kmeans", values = c("kmeans", "lvq")),
makeIntegerLearnerParam(id = "tries", default = 5L, lower = 1L),
makeDiscreteLearnerParam(id = "criterion", default = "misclassification", values = c("misclassification", "deviance"))
makeDiscreteLearnerParam(id = "criterion", default = "misclassification", special.vals = c("misclassification", "deviance"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
makeDiscreteLearnerParam(id = "criterion", default = "misclassification", special.vals = c("misclassification", "deviance"))
makeDiscreteLearnerParam(id = "criterion", default = "misclassification", values = c("misclassification", "deviance"))

special.vals are meant for values that do not match the param type. It also does not make much sense to define a DiscreteParam without discrete values.

),
par.vals = list(keep.fitted = FALSE, start.method = "lvq"),
properties = c("twoclass", "multiclass", "numerics", "factors", "prob"),
Expand Down
5 changes: 3 additions & 2 deletions R/RLearner_regr_mob.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ makeRLearner.regr.mob = function() {
makeNumericLearnerParam(id = "trim", default = 0.1, lower = 0, upper = 1),
makeLogicalLearnerParam(id = "breakties", default = FALSE),
makeLogicalLearnerParam(id = "verbose", default = FALSE, tunable = FALSE),
makeDiscreteLearnerParam(id = "model", default = modeltools::glinearModel,
values = list(glinearModel = modeltools::glinearModel, linearModel = modeltools::linearModel)),
# see helpers_modeltools.R for `glinearModel`
makeUntypedLearnerParam(id = "model", default = function(...) modeltools::glinearModel(...),
special.vals = list(glinearModel = function(...) modeltools::glinearModel(...), linearModel = function(...) modeltools::glinearModel(...))),
makeUntypedLearnerParam(id = "part.feats"),
makeUntypedLearnerParam(id = "term.feats")
),
Expand Down