plotComparativeCV | R Documentation |
This function generates a plot comparing the cross-validation (CV) performance (such as AUC, accuracy, or other scores) across multiple methods for different values of the sparse parameter (k sparse). The plot includes lines representing each method and points indicating the empirical or generalization performance score at each k sparse value. Optional error bars (confidence intervals) can be included in the plot.
plotComparativeCV(
digested.results,
ylim = c(0.5, 1),
generalization = TRUE,
score = "auc_",
ci = TRUE,
main = ""
)
digested.results |
A list containing the CV results of the models, including performance scores for various methods. |
ylim |
A numeric vector of length 2 specifying the limits for the y-axis. Default is 'c(0.5, 1)'. |
generalization |
A logical value ('TRUE' or 'FALSE'). If 'TRUE', the plot shows the generalization performance (cross-validation performance across folds). If 'FALSE', it shows empirical performance. Default is 'TRUE'. |
score |
A string specifying which score to visualize, e.g., "auc_", "accuracy_", "recall_", etc. Default is '"auc_"'. |
ci |
A logical value ('TRUE' or 'FALSE'). If 'TRUE', confidence intervals (error bars) are shown in the plot. Default is 'TRUE'. |
main |
A string specifying the title of the plot. Default is an empty string. |
The function plots cross-validation (CV) scores (such as AUC, accuracy, etc.) for different methods across various values of k sparse. It handles both generalization (cross-validation) and empirical tasks, and includes optional error bars representing confidence intervals for each score.
The plot is created using ggplot2
, and different methods can be
assigned different colors and point shapes. Horizontal lines indicate
important thresholds, such as AUC = 0.5 or the majority class in
classification tasks.
A ggplot object visualizing the comparative cross-validation (CV) scores across multiple methods.
Edi Prifti (IRD)
# Assuming digested.results contains the cross-validation performance scores for methods
plotComparativeCV(digested.results, ylim = c(0.5, 1), score = "auc_", ci = TRUE, main = "Comparison of AUC across Methods")
# You can customize the plot by adjusting the score, error bars (ci), and other parameters.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.