plot_performance: Plots of performance metrics in the training, resample and...

View source: R/utils_plotting.R

plot_performanceR Documentation

Plots of performance metrics in the training, resample and test data.

Description

This internally utilized function takes a caretx model and plots selected performance stats appropriate for the prediction type in the test, resample and, optionally, training data set. Scatter plots are generated, the data set type is color-coded and, optionally, indicated in the plot.

Usage

plot_performance(
  caretx_object,
  newdata = NULL,
  plot_subtitle = NULL,
  plot_tag = NULL,
  show_txt = FALSE,
  txt_size = 2.75,
  cust_theme = ggplot2::theme_classic(),
  ...
)

Arguments

caretx_object

a caretx object.

newdata

optional, a data frame with predictions.

plot_subtitle

plot subtitle, see: Details.

plot_tag

plot tag.

show_txt

logical, should the data set names (training, CV and test) be displayed in the plot?

txt_size

size of the text labels of the data sets.

cust_theme

a custom ggplot theme

...

extra arguments passed to geom_text_repel

Details

The plotted performance stats are:

  • for regression: pseudo-R-squared (Y axis) and root mean square error (RMSE, X axis), Spearman's coefficient for correlation of the outcome and prediction is represented by the point size.

  • for classification: Brier score (Y axis) and Cohen's kappa, the overall accuracy is represented by the point size.

Numbers of complete observations are displayed in the plot subtitle, if no user-provided subtitle is specified.

Value

a ggplot graphic.


PiotrTymoszuk/caretExtra documentation built on Oct. 15, 2023, 10:03 p.m.