View source: R/utils_plotting.R
plot_performance | R Documentation |
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.
plot_performance(
caretx_object,
newdata = NULL,
plot_subtitle = NULL,
plot_tag = NULL,
show_txt = FALSE,
txt_size = 2.75,
cust_theme = ggplot2::theme_classic(),
...
)
caretx_object |
a |
newdata |
optional, a data frame with predictions. |
plot_subtitle |
plot subtitle, see: |
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 |
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.
a ggplot graphic.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.