Skip to content

Commit 1e525bb

Browse files
committed
Test that can augment models without class probability support
1 parent fcb1071 commit 1e525bb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/testthat/test-augment.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,18 @@ test_that('classification models', {
7676

7777
})
7878

79+
80+
test_that('augment for model without class probabilities', {
81+
skip_if_not_installed("LiblineaR")
82+
83+
data(two_class_dat, package = "modeldata")
84+
x <- svm_linear(mode = "classification") %>% set_engine("LiblineaR")
85+
cls_form <- x %>% fit(Class ~ ., data = two_class_dat)
86+
87+
expect_equal(
88+
colnames(augment(cls_form, head(two_class_dat))),
89+
c("A", "B", "Class", ".pred_class")
90+
)
91+
expect_equal(nrow(augment(cls_form, head(two_class_dat))), 6)
92+
93+
})

0 commit comments

Comments
 (0)