tests/testthat/test-classification_plot.R

context("classification plots")

df = data.frame(label = c(F, F, F, T, T, F, T, F, T, T, T),
                prediction = seq(0, 1, 0.1))

test_that("pr_plot", {

  g = pr_plot(df, "prediction", "label")
  expect_equal(nrow(g$data), 11)

})


test_that("lift_plot", {

  g = lift_plot(df, "prediction", "label")
  expect_equal(nrow(g$data), 11)

})
wkostelecki/ezplot documentation built on Feb. 1, 2024, 10:58 p.m.