tests/testthat/test_cholesky_vs_inverse.R

context("Cholesky and inverse solver doing the same (for simple data)")

test_that("cholesky does the same as inverse", {
  expect_output({
    cboost_chol = boostSplines(data = iris, target = "Sepal.Width", loss = LossQuadratic$new(), cache_type = "cholesky")
  })
  expect_output({
    cboost_inv = boostSplines(data = iris, target = "Sepal.Width", loss = LossQuadratic$new(), cache_type = "inverse")
  })
  expect_equal(cboost_chol$getCoef(), cboost_inv$getCoef())
})
schalkdaniel/compboost documentation built on April 15, 2023, 9:03 p.m.