Skip to content

Commit

Permalink
cover the newly added code
Browse files Browse the repository at this point in the history
  • Loading branch information
bcjaeger committed Mar 9, 2024
1 parent 9f3c060 commit 79e134e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/testthat/test-orsf_vint.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,29 @@ test_that(

}
)

test_that(
desc = "vint succeeds on categorical forests",
code = {

skip_on_cran()

fit <- orsf(species ~ ., data = penguins_orsf)

vints <- orsf_vint(fit)

expect_true(all(levels(penguins_orsf$species) %in% vints$class))

penguins_bnry <- penguins_orsf
penguins_bnry$species <- factor(penguins_bnry$species == "Adelie",
levels = c(FALSE, TRUE),
labels = c("Other", "adelie"))

fit <- orsf(species ~ ., data = penguins_bnry)

vints <- orsf_vint(fit)

expect_true(all(levels(penguins_bnry$species) %in% vints$class))

}
)

0 comments on commit 79e134e

Please sign in to comment.