plot.thresholds_df: Plot threshold performance metrics

Description Usage Arguments Value See Also Examples

View source: R/get_thresholds.R

Description

Plot threshold performance metrics

Usage

1
2
3
4
## S3 method for class 'thresholds_df'
plot(x, title = NULL, caption = NULL,
  font_size = 11, line_size = 0.5, point_size = NA, ncol = 2,
  print = TRUE, ...)

Arguments

x

A threshold_df object from get_thresholds or a data frame with columns "threshold" and other columns to be plotted against thresholds. If optimize was provided to get_thresholds a line is drawn in each facet corresponding to the optimal threshold.

title

Plot title. Default NULL produces no title

caption

Plot caption. Default NULL produces no caption unless get_thresholds(optimize) was provided, in which case information about the threshold and performance are provided in the caption.

font_size

Relative size of all fonts in plot, default = 11

line_size

Width of lines, default = 0.5

point_size

Point size. Default is NA which suppresses points. Set to a number to see where threholds are.

ncol

Number of columns of facets.

print

Print the plot? Default = TRUE

...

Unused

Value

A ggplot object, invisibly.

See Also

get_thresholds

Examples

1
2
3
4
5
6
7
8
m <- machine_learn(pima_diabetes[1:100, ], patient_id, outcome = diabetes,
                   models = "xgb", tune = FALSE, n_folds = 3)

get_thresholds(m) %>%
  plot()

get_thresholds(m, optimize = "cost", measures = c("acc", "cost"), cost_fn = 3) %>%
  plot(point_size = .5, ncol = 1)

healthcareai documentation built on Sept. 2, 2018, 1:03 a.m.