File: test_base_estimateResidualVariance.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 (10 lines) | stat: -rwxr-xr-x 313 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10

test_that("estimateResidualVariance", {
  set.seed(getOption("mlr.debug.seed"))
  task = regr.task
  lrn = makeLearner("regr.lm")
  x1 = estimateResidualVariance(lrn, task)
  x2 = estimateResidualVariance(lrn, data = regr.df, target = regr.target)
  expect_equal(round(x1, 4), 21.9382)
  expect_equal(x1, x2)
})