tests/testthat/test-interpreters.R

test_that("iht_interpreter works", {

  model <- mmir_model(mpg ~ -1 + hp + wt, data = mtcars, engine = "lm", standardize = TRUE)
  iht_res <- restriktor::iht(model, constraints = 'hp < wt')
  res <- iht_interpreter(iht_res)


  expect_true(is.character(res))
  expect_error(iht_interpreter(model))
})

test_that("rm_interpreter works", {

  model <- mmir_model(mpg ~ -1 + hp + wt, data = mtcars, engine = "lm", standardize = TRUE)
  rm_res <- restriktor::restriktor(model, constraints = 'hp < wt')
  res <- rm_interpreter(rm_res)


  expect_true(is.character(res))
  expect_error(iht_interpreter(model))
})

Try the mmirestriktor package in your browser

Any scripts or data that you put into this service are public.

mmirestriktor documentation built on June 24, 2024, 1:07 a.m.