roc_plot | R Documentation |
This function generates Receiver Operating Characteristic (ROC) curves to evaluate models
roc_plot(
probability_list,
split_df,
...,
multiple_plots = TRUE,
text_size = 10,
palette = "viridis",
save = FALSE,
file_path = NULL,
file_name = "ROC_plot",
file_type = "pdf",
plot_width = 7,
plot_height = 7,
dpi = 80
)
probability_list |
A |
split_df |
A |
... |
Additional arguments to be passed on to
|
multiple_plots |
Logical. If |
text_size |
Text size for plot labels, axis labels etc. Default is
|
palette |
Viridis color palette option for plots. Default is
|
save |
Logical. If |
file_path |
A string containing the directory path to save the file. |
file_name |
File name to save the plot.
Default is |
file_type |
File type to save the plot.
Default is |
plot_width |
Width of the plot. Default is |
plot_height |
Height of the plot. Default is |
dpi |
Plot resolution. Default is |
roc_plot
first uses probabilities generated
during test_models
to build a ROC object.
Next, relevant information is extracted from the ROC object to plot the ROC curves.
A ggplot2
object.
Chathurani Ranathunge
test_models
roc
## Create a model_df object
covid_model_df <- pre_process(covid_fit_df, covid_norm_df)
## Split the data frame into training and test data sets
covid_split_df <- split_data(covid_model_df)
## Fit models using the default list of machine learning (ML) algorithms
covid_model_list <- train_models(covid_split_df)
# Test a list of models on a test data set and output class probabilities,
covid_prob_list <- test_models(covid_model_list, covid_split_df, type = "prob")
## Plot ROC curves separately for each ML algorithm
roc_plot(covid_prob_list, covid_split_df)
## Plot all ROC curves in one plot
roc_plot(covid_prob_list, covid_split_df, multiple_plots = FALSE)
## Change color palette
roc_plot(covid_prob_list, covid_split_df, palette = "plasma")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.