draw_roc: Plot the ROC curve

Description Usage Arguments Value See Also Examples

View source: R/metrics.R

Description

Plot the ROC curve.

Usage

1
draw_roc(data, recall = "Recall", specificity = "Specificity")

Arguments

data

A dataframe or a list of dataframes with the recall and the specificity.

recall

A string (default = "Recall"). The column's name of the computed recall.

specificity

A string (default = "Specificity"). The column's name of the computed specificity.

Value

A ggplot2 object.

See Also

compute_predict_class, compute_metrics

Examples

1
2
3
4
5
6
7
8
9
data <- data.frame(
  obs = c(rep("Yes", 20), rep("No", 20)),
  prob = c(runif(n = 20, min = 0.3, max = 0.8),
           runif(n = 20, min = 0.1, max = 0.6))
)

metrics <- compute_metrics(data, threshold = c(0.3, 0.7, 0.2))

draw_roc(metrics)

thoera/metrics documentation built on Nov. 20, 2019, 2:01 p.m.