tests/roc.R

library(breakpointError)
guesses <- list(c(), 3, 5, c(5, 8), 1:11)
rates <- errorRates(guesses, 5L, 12L)
stopifnot(all.equal(c(1, 0,   0, 0,  0), rates$FN))
stopifnot(all.equal(c(0, 0,   0, 1,  10), rates$FP))
stopifnot(all.equal(c(0, 0.5, 0, 0,   0), rates$I))
stopifnot(all.equal(c(1, 0.5, 0, 1,  10), rates$error))
stopifnot(all.equal(c(0, 0,   0, 0.1, 1), rates$FPR))
stopifnot(all.equal(c(1, 0.5, 0, 0,   0), rates$FNR))
stopifnot(all.equal(c(0, 0.5, 1, 1,   1), rates$TPR))

Try the breakpointError package in your browser

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

breakpointError documentation built on May 2, 2019, 5:22 p.m.