Skip to content

Commit e7458be

Browse files
committed
Merge branch 'prepare_2.19.1'
2 parents 7bf07a1 + a7187fe commit e7458be

File tree

89 files changed

+326
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+326
-78
lines changed

.github/workflows/check.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ jobs:
8686
if: ${{ matrix.action == 'githubversions' }}
8787
shell: Rscript {0}
8888
run: |
89-
system("sudo apt-get install libhiredis-dev")
90-
remotes::install_github("mlr-org/paradox")
91-
remotes::install_github("mlr-org/bbotk")
92-
remotes::install_github("mlr-org/mlr3tuning")
89+
remotes::install_github("zmjones/mmpf/pkg")
90+
remotes::install_github("mb706/SwarmSVM@patch-1")
9391
- name: Session Info
9492
shell: Rscript {0}
9593
run: |

DESCRIPTION

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Authors@R: c(
77
person("Michel", "Lang", , "[email protected]", role = "aut",
88
comment = c(ORCID = "0000-0001-9754-0393")),
99
person("Lars", "Kotthoff", , "[email protected]", role = "aut"),
10-
person("Patrick", "Schratz", , "[email protected]", role = c("aut", "cre"),
10+
person("Patrick", "Schratz", , "[email protected]", role = "aut",
1111
comment = c(ORCID = "0000-0003-0748-6624")),
1212
person("Julia", "Schiffner", , "[email protected]", role = "aut"),
1313
person("Jakob", "Richter", , "[email protected]", role = "aut"),
@@ -35,7 +35,7 @@ Authors@R: c(
3535
comment = c(ORCID = "0000-0002-8872-8535")),
3636
person("Quay", "Au", , "[email protected]", role = "ctb",
3737
comment = c(ORCID = "0000-0002-5252-8902")),
38-
person("Martin", "Binder", , "[email protected]", role = "ctb"),
38+
person("Martin", "Binder", , "[email protected]", role = c("aut", "cre")),
3939
person("Florian", "Pfisterer", , "[email protected]", role = "ctb"),
4040
person("Stefan", "Coors", , "[email protected]", role = "ctb"),
4141
person("Steve", "Bronder", , "[email protected]", role = "ctb"),
@@ -147,7 +147,6 @@ Suggests:
147147
rappdirs,
148148
refund,
149149
rex,
150-
mmpf,
151150
rFerns,
152151
rgenoud,
153152
rmarkdown,
@@ -175,9 +174,6 @@ Suggests:
175174
vdiffr,
176175
wavelets,
177176
xgboost (>= 0.7)
178-
Remote:
179-
zmjones/mmpf/pkg,
180-
mb706/SwarmSVM@patch-1
181177
VignetteBuilder:
182178
knitr
183179
ByteCompile: yes

R/ClassificationViaRegressionWrapper.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
#' @export
1515
#' @family wrapper
1616
#' @examples
17+
#' \dontshow{ if (requireNamespace("rpart")) \{ }
1718
#' lrn = makeLearner("regr.rpart")
1819
#' lrn = makeClassificationViaRegressionWrapper(lrn)
1920
#' mod = train(lrn, sonar.task, subset = 1:140)
2021
#' predictions = predict(mod, newdata = getTaskData(sonar.task)[141:208, 1:60])
22+
#' \dontshow{ \} }
2123
makeClassificationViaRegressionWrapper = function(learner, predict.type = "response") {
2224
learner = checkLearner(learner, "regr")
2325
lrn = makeBaseWrapper(

R/FeatSelWrapper.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
#' @family wrapper
2020
#' @export
2121
#' @examples
22+
#' \dontshow{ if (requireNamespace("kernlab")) \{ }
2223
#' # nested resampling with feature selection (with a nonsense algorithm for selection)
2324
#' outer = makeResampleDesc("CV", iters = 2L)
2425
#' inner = makeResampleDesc("Holdout")
2526
#' ctrl = makeFeatSelControlRandom(maxit = 1)
2627
#' lrn = makeFeatSelWrapper("classif.ksvm", resampling = inner, control = ctrl)
2728
#' # we also extract the selected features for all iteration here
2829
#' r = resample(lrn, iris.task, outer, extract = getFeatSelResult)
30+
#' \dontshow{ \} }
2931
makeFeatSelWrapper = function(learner, resampling, measures, bit.names, bits.to.features,
3032
control, show.info = getMlrOption("show.info")) {
3133

R/FilterWrapper.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#' passed down to the next learner.
6565
#'
6666
#' @examples
67+
#' \dontshow{ if (requireNamespace("FSelectorRcpp")) \{ }
6768
#' \donttest{
6869
#' task = makeClassifTask(data = iris, target = "Species")
6970
#' lrn = makeLearner("classif.lda")
@@ -111,6 +112,7 @@
111112
#' })
112113
#' print(r$extract)
113114
#' }
115+
#' \dontshow{ \} }
114116
makeFilterWrapper = function(learner, fw.method = "FSelectorRcpp_information.gain",
115117
fw.base.methods = NULL, fw.perc = NULL, fw.abs = NULL, fw.threshold = NULL,
116118
fw.fun = NULL, fw.fun.args = NULL, fw.mandatory.feat = NULL, cache = FALSE, ...) {

R/ModelMultiplexer.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#' more readable. I.e., the artificial prefix before parameter names is
3030
#' suppressed.
3131
#' @examples
32+
#' \dontshow{ if (requireNamespace("kernlab")) \{ }
3233
#' set.seed(123)
3334
#' \donttest{
3435
#' library(BBmisc)
@@ -76,6 +77,7 @@
7677
#'
7778
#' # all three ps-objects are exactly the same internally.
7879
#' }
80+
#' \dontshow{ \} }
7981
makeModelMultiplexer = function(base.learners) {
8082

8183
lrn = makeBaseEnsemble(

R/RLearner_classif_clusterSVM.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ makeRLearner.classif.clusterSVM = function() {
3636
#' @export
3737
trainLearner.classif.clusterSVM = function(.learner, .task, .subset, .weights = NULL, ...) {
3838
d = getTaskData(.task, .subset, target.extra = TRUE)
39-
SwarmSVM::clusterSVM(x = d$data, y = d$target, ...)
39+
pname = "SwarmSVM"
40+
asNamespace(pname)$clusterSVM(x = d$data, y = d$target, ...)
4041
}
4142

4243
#' @export

R/RLearner_classif_dcSVM.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@ trainLearner.classif.dcSVM = function(.learner, .task, .subset, .weights = NULL,
6868

6969

7070
if (m.flag && max.levels.flag) {
71-
SwarmSVM::dcSVM(x = d$data, y = d$target, m = m, max.levels = max.levels, ...)
71+
pname = "SwarmSVM"
72+
asNamespace(pname)$dcSVM(x = d$data, y = d$target, m = m, max.levels = max.levels, ...)
7273
} else if (!m.flag && max.levels.flag) {
73-
SwarmSVM::dcSVM(x = d$data, y = d$target, max.levels = max.levels, ...)
74+
pname = "SwarmSVM"
75+
asNamespace(pname)$dcSVM(x = d$data, y = d$target, max.levels = max.levels, ...)
7476
} else if (m.flag && !max.levels.flag) {
75-
SwarmSVM::dcSVM(x = d$data, y = d$target, m = m, ...)
77+
pname = "SwarmSVM"
78+
asNamespace(pname)$dcSVM(x = d$data, y = d$target, m = m, ...)
7679
} else {
77-
SwarmSVM::dcSVM(x = d$data, y = d$target, ...)
80+
pname = "SwarmSVM"
81+
asNamespace(pname)$dcSVM(x = d$data, y = d$target, ...)
7882
}
7983
}
8084

R/RLearner_classif_gaterSVM.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ makeRLearner.classif.gaterSVM = function() {
3030
#' @export
3131
trainLearner.classif.gaterSVM = function(.learner, .task, .subset, .weights = NULL, ...) {
3232
d = getTaskData(.task, .subset, target.extra = TRUE)
33-
SwarmSVM::gaterSVM(x = d$data, y = d$target, ...)
33+
pname = "SwarmSVM"
34+
asNamespace(pname)$gaterSVM(x = d$data, y = d$target, ...)
3435
}
3536

3637
#' @export

R/ResampleInstances.R

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,25 @@
1111
#' The size of the resample.
1212
#' @param task ([Task] | `NULL`)\cr
1313
#' A task, necessary only for some resampling methods.
14+
#' @param coords (`character(2)`)\cr
15+
#' Names of task coordinates.
16+
#' Not currently used.
1417
#' @return ([ResampleInstance])\cr
1518
#' An instantiated resample instance.
1619
#' @keywords internal
1720
#' @export
18-
instantiateResampleInstance = function(desc, size, task) {
21+
instantiateResampleInstance = function(desc, size, task = NULL, coords) {
1922
UseMethod("instantiateResampleInstance")
2023
}
2124

2225
#' @export
23-
instantiateResampleInstance.HoldoutDesc = function(desc, size, task = NULL) {
26+
instantiateResampleInstance.HoldoutDesc = function(desc, size, task = NULL, coords) {
2427
inds = sample(size, size * desc$split)
2528
makeResampleInstanceInternal(desc, size, train.inds = list(inds))
2629
}
2730

2831
#' @export
29-
instantiateResampleInstance.CVDesc = function(desc, size, task = NULL) {
32+
instantiateResampleInstance.CVDesc = function(desc, size, task = NULL, coords) {
3033
# Random sampling CV
3134
if (!desc$fixed) {
3235
if (desc$iters > size) {
@@ -78,7 +81,7 @@ instantiateResampleInstance.CVDesc = function(desc, size, task = NULL) {
7881
}
7982

8083
#' @export
81-
instantiateResampleInstance.SpCVDesc = function(desc, size, task = NULL) {
84+
instantiateResampleInstance.SpCVDesc = function(desc, size, task = NULL, coords) {
8285

8386
if (is.null(task)) {
8487
stopf("Please provide a task.")
@@ -101,25 +104,24 @@ instantiateResampleInstance.SpCVDesc = function(desc, size, task = NULL) {
101104
}
102105

103106
#' @export
104-
instantiateResampleInstance.LOODesc = function(desc, size, task = NULL) {
107+
instantiateResampleInstance.LOODesc = function(desc, size, task = NULL, coords) {
105108
desc$iters = size
106109
makeResampleInstanceInternal(desc, size, test.inds = as.list(seq_len(size)))
107110
}
108111

109112
#' @export
110-
instantiateResampleInstance.SubsampleDesc = function(desc, size, task = NULL) {
113+
instantiateResampleInstance.SubsampleDesc = function(desc, size, task = NULL, coords) {
111114
inds = lapply(seq_len(desc$iters), function(x) sample(size, size * desc$split))
112115
makeResampleInstanceInternal(desc, size, train.inds = inds)
113116
}
114117

115-
#' @export
116-
instantiateResampleInstance.BootstrapDesc = function(desc, size, task = NULL) {
118+
instantiateResampleInstance.BootstrapDesc = function(desc, size, task = NULL, coords) {
117119
inds = lapply(seq_len(desc$iters), function(x) sample(size, size, replace = TRUE))
118120
makeResampleInstanceInternal(desc, size, train.inds = inds)
119121
}
120122

121123
#' @export
122-
instantiateResampleInstance.RepCVDesc = function(desc, size, task = NULL) {
124+
instantiateResampleInstance.RepCVDesc = function(desc, size, task = NULL, coords) {
123125
folds = desc$iters / desc$reps
124126
d = makeResampleDesc("CV", iters = folds, blocking.cv = desc$blocking.cv, fixed = desc$fixed)
125127
i = replicate(desc$reps, makeResampleInstance(d, size = size), simplify = FALSE)
@@ -130,7 +132,7 @@ instantiateResampleInstance.RepCVDesc = function(desc, size, task = NULL) {
130132
}
131133

132134
#' @export
133-
instantiateResampleInstance.SpRepCVDesc = function(desc, size, task = NULL) {
135+
instantiateResampleInstance.SpRepCVDesc = function(desc, size, task = NULL, coords) {
134136
folds = desc$iters / desc$reps
135137
d = makeResampleDesc("SpCV", iters = folds)
136138
i = replicate(desc$reps, makeResampleInstance(d, task = task), simplify = FALSE)
@@ -151,7 +153,7 @@ instantiateResampleInstance.GrowingWindowCVDesc = function(desc, size, task = NU
151153
}
152154

153155
#' @export
154-
instantiateResampleInstance.CVHelperDesc = function(desc, size, task = NULL) {
156+
instantiateResampleInstance.CVHelperDesc = function(desc, size, task = NULL, coords) {
155157
if (desc$iters > size) {
156158
stopf("Cannot use more folds (%i) than size (%i)!", desc$iters, size)
157159
}

0 commit comments

Comments
 (0)