File: test_regr_evtree.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 (23 lines) | stat: -rwxr-xr-x 576 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

test_that("regr_evtree", {
  requirePackagesOrSkip("evtree", default.method = "load")

  parset.list = list(
    list(),
    list(maxdepth = 2),
    list(ntrees = 200)
  )

  old.predicts.list = list()

  for (i in seq_along(parset.list)) {
    parset = parset.list[[i]]
    pars = list(regr.formula, data = regr.train)
    pars = c(pars, parset)
    m = do.call(evtree::evtree, pars)
    old.predicts.list[[i]] = as.vector(predict(m, newdata = regr.test))
  }

  testSimpleParsets("regr.evtree", regr.df, regr.target, regr.train.inds,
    old.predicts.list, parset.list)
})