Skip to content

Commit

Permalink
add test for ROC function
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Mar 23, 2024
1 parent 4a27a1c commit 44e145b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions tests/testthat/test-plot.performance_roc.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ test_that("`plot.see_performance_roc()` works", {
folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE)
test_data <- iris[folds, ]
train_data <- iris[-folds, ]
model <- glm(
model <- stats::glm(
y ~ Sepal.Length + Sepal.Width,
data = train_data,
family = "binomial"
)
result <- performance::performance_roc(model, new_data = test_data)

expect_s3_class(plot(result), "gg")
vdiffr::expect_doppelganger(
title = "plot.see_performance_roc() works",
fig = plot(result)
)
})

0 comments on commit 44e145b

Please sign in to comment.