.Viz.ClassifierCurve.dx_cutoff <- function(x){
metrics = c(accuracy='acc', sensitivity='sens', specificity='spec',
PPV='ppv', NPV='npv')
dx_dat <- map_df(metrics, function(metric){
performance(x@pred, metric) %>%
(function(perf) {
data.frame(
x = perf %>% slot("x.values") %>% unlist,
y = perf %>% slot("y.values") %>% unlist)})
}, .id='metric')
dx_plt <- ggplot(dx_dat, aes(x=x, y=y, col=metric))+
geom_line() +
labs(title = paste('Performance by Threshold'),
subtitle = '2017.06.23',
x = 'Cutoff',
y = 'Score')}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.