Skip to content

Commit

Permalink
Merge pull request #17 from mayer79/missing_tests
Browse files Browse the repository at this point in the history
Add some tests
  • Loading branch information
mayer79 authored Jul 1, 2023
2 parents 0c4501b + 5e25261 commit 51d0f29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/testthat/test_interact.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test_that("Additive models show 0 interactions (univariate)", {
)
expect_equal(H2(inter), 0)
expect_s3_class(H2_j(inter), "ggplot")
expect_s3_class(plot(inter), "ggplot")
})

test_that("Additive models show 0 interactions (multivariate)", {
Expand All @@ -24,6 +25,7 @@ test_that("Additive models show 0 interactions (multivariate)", {
)
expect_equal(H2(inter), c(Sepal.Length = 0, Sepal.Width = 0))
expect_s3_class(H2_j(inter), "ggplot")
expect_s3_class(plot(inter), "ggplot")
})

test_that("Non-additive models show interactions > 0 (one interaction)", {
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test_pdp.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ g <- 2:1
test_that("pd_raw() works for simple example", {
pd <- pd_raw(1, v = "a", X = X, grid = g, pred_fun = pfun)
expect_equal(pd, cbind(pred = g / 2))
capture_output(expect_no_error(print(pd)))
})

test_that("pd_raw() works on simple example with and without grid compression", {
Expand Down

0 comments on commit 51d0f29

Please sign in to comment.