Nothing
testthat::test_that("FP: initialize function works", {
lvs <- c("normal", "abnormal")
truth <- factor(rep(lvs, times = c(86, 258)),
levels = rev(lvs))
pred <- factor(
c(
rep(lvs, times = c(54, 32)),
rep(lvs, times = c(27, 231))),
levels = rev(lvs))
xtab <- table(pred, truth)
confMatrix <- ConfMatrix$new(confMatrix = caret::confusionMatrix(xtab))
testthat::expect_is(FP$new(performance = confMatrix),
"FP")
})
testthat::test_that("FP: compute function works", {
lvs <- c("normal", "abnormal")
truth <- factor(rep(lvs, times = c(86, 258)),
levels = rev(lvs))
pred <- factor(
c(
rep(lvs, times = c(54, 32)),
rep(lvs, times = c(27, 231))),
levels = rev(lvs))
xtab <- table(pred, truth)
confMatrix <- ConfMatrix$new(confMatrix = caret::confusionMatrix(xtab))
testthat::expect_is(FP$new(performance = confMatrix)$compute(performance.output = NULL),
"character")
testthat::expect_is(FP$new(performance = NULL)$compute(performance.output = confMatrix),
"character")
})
testthat::test_that("FP: compute function checks parameter type", {
testthat::expect_error(FP$new(performance = NULL)$compute(performance.output = NULL),
"[FP][FATAL] Performance output parameter must be defined as 'MinResult' or 'ConfMatrix' type. Aborting...",
fixed = TRUE)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.