draw_metrics: Plot the selected metrics

Description Usage Arguments Value See Also Examples

View source: R/metrics.R

Description

Plot the selected metrics.

Usage

1
2
draw_metrics(data, metric = c("Accuracy", "Precision", "Recall",
  "Specificity", "NPV", "F1"), threshold = "threshold")

Arguments

data

A dataframe or a list of dataframes with the metrics computed.

metric

A string or a vector of string. The metric(s) to plot.

threshold

A string (default = "threshold"). The column's name of the threshold.

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_metrics(metrics)

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