Skip to content

Commit c2d40a3

Browse files
mb706berndbischl
authored andcommitted
New parameter 'method' for classif.plsdaCaret. This fixes #1544 (#1555)
1 parent 5018f58 commit c2d40a3

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* getOOBPreds: get out-of-bag predictions from trained models for learners that store them -- these learners have the new "oobpreds" property
55
* listTaskTypes, listLearnerProperties
66

7+
## learners - general
8+
* classif.plsdaCaret: added parameter "method".
9+
10+
711
## learners - removed
812
* {classif,regr}.avNNet: no longer necessary, mlr contains a bagging wrapper
913

R/RLearner_classif_plsdaCaret.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ makeRLearner.classif.plsdaCaret = function() {
44
package = "caret",
55
par.set = makeParamSet(
66
makeIntegerLearnerParam(id = "ncomp", default = 2, lower = 1),
7-
makeDiscreteLearnerParam(id = "probMethod", values = c("softmax", "Bayes"), default = "softmax")
7+
makeDiscreteLearnerParam(id = "probMethod", values = c("softmax", "Bayes"), default = "softmax"),
8+
makeDiscreteLearnerParam(id = "method", default = "kernelpls",
9+
values = c("kernelpls", "widekernelpls", "simpls", "oscorespls"))
810
),
911
properties = c("numerics", "prob", "twoclass"),
1012
name = "Partial Least Squares (PLS) Discriminant Analysis",
@@ -15,7 +17,7 @@ makeRLearner.classif.plsdaCaret = function() {
1517
#' @export
1618
trainLearner.classif.plsdaCaret = function(.learner, .task, .subset, .weights, ...) {
1719
d = getTaskData(.task, .subset, target.extra = TRUE)
18-
caret::plsda(d$data, d$target, method = "oscorespls", ...)
20+
caret::plsda(d$data, d$target, ...)
1921
}
2022

2123
#' @export

tests/testthat/test_classif_plsdaCaret.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ test_that("classif_plsdaCaret", {
55
parset.list = list(
66
list(),
77
list(ncomp = 4),
8-
list(probMethod = "Bayes")
8+
list(probMethod = "Bayes"),
9+
list(method = "oscorespls")
910
)
1011

1112
old.predicts.list = list()

0 commit comments

Comments
 (0)