tests/testthat/test-plot.performance_roc.R

test_that("`plot.see_performance_roc()` works", {
  set.seed(123)
  iris$y <- rbinom(nrow(iris), size = 1, 0.3)
  folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE)
  test_data <- iris[folds, ]
  train_data <- iris[-folds, ]
  model <- 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")
})

Try the see package in your browser

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

see documentation built on Nov. 3, 2023, 5:10 p.m.