File: test_learners_all_multilabel.R

package info (click to toggle)
r-cran-mlr 2.19.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,392 kB
  • sloc: ansic: 65; sh: 13; makefile: 5
file content (39 lines) | stat: -rwxr-xr-x 1,602 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

test_that("learners work: multilabel", {

  # settings to make learners faster and deal with small sample size
  hyperpars = list()

  # multiabel
  lrns = listLearnersCustom("multilabel", create = TRUE)
  lapply(lrns, testThatLearnerParamDefaultsAreInParamSet)
  lapply(lrns, testBasicLearnerProperties, task = multilabel.task,
    hyperpars = hyperpars)

  # multilabel, probs
  lrns = listLearnersCustom("multilabel", properties = "prob", create = TRUE)
  lapply(lrns, testBasicLearnerProperties, task = multilabel.task,
    hyperpars = hyperpars, pred.type = "prob")

  # multilabel, factors
  lrns = listLearnersCustom("multilabel", properties = "factors", create = TRUE)
  lapply(lrns, testThatLearnerHandlesFactors, task = multilabel.task,
    hyperpars = hyperpars)

  # multilabel, ordered
  lrns = listLearnersCustom("multilabel", properties = "ordered", create = TRUE)
  lapply(lrns, testThatLearnerHandlesOrderedFactors, task = multilabel.task,
    hyperpars = hyperpars)

  # multilabel, missings
  lrns = listLearnersCustom("multilabel", properties = "missings", create = TRUE)
  lapply(lrns, testThatLearnerHandlesMissings, task = multilabel.task,
    hyperpars = hyperpars)

  # multilabel, weights
  lrns = listLearnersCustom("multilabel", properties = "weights", create = TRUE)
  lapply(lrns, testThatLearnerRespectsWeights, hyperpars = hyperpars,
    task = multilabel.task, train.inds = multilabel.train.inds, multilabel.test.inds,
    weights = rep(c(10000L, 1L), c(10L, length(multilabel.train.inds) - 10L)),
    pred.type = "prob", get.pred.fun = getPredictionProbabilities)
})