tests/testthat/test_explain.R

context("Check explain() function")

test_that("Type of data in the explainer",{
  library("tibble", warn.conflicts = FALSE, quietly = TRUE)
  apartments_test_tibble <- tibble::as_tibble(apartments_test)
  model_liniowy <- lm(m2.price ~ construction.year + surface + floor + no.rooms + district, data = apartments)

  explainer_lm <- explain(model_liniowy, data = apartments_test_tibble[,2:6], y = apartments_test_tibble$m2.price)

  expect_true(is.data.frame(explainer_lm$data))
})

Try the DALEX2 package in your browser

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

DALEX2 documentation built on May 2, 2019, 1:19 p.m.