tests/testthat/test_base_estimateResidualVariance.R

context("estimateResidualVariance")

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)
})
guillermozbta/s2 documentation built on Jan. 2, 2018, 12:25 a.m.