plotComparativeBestCV: Plot Comparative Best Cross-Validation (CV) Performance for...

View source: R/global.visu.R

plotComparativeBestCVR Documentation

Plot Comparative Best Cross-Validation (CV) Performance for Multiple Methods

Description

This function generates a plot comparing the best 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 best CV performance score at each k sparse value. Optional error bars (confidence intervals) can be included in the plot. The best method for each k sparse is also indicated in the legend.

Usage

plotComparativeBestCV(
  digested.results,
  ylim = c(0.5, 1),
  generalization = TRUE,
  score = "auc_",
  ci = TRUE,
  main = ""
)

Arguments

digested.results

A list containing the best 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.

Details

The function plots the best 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.

The plot also includes a legend with the best method for each k sparse value.

Value

A ggplot object visualizing the best cross-validation (CV) scores across multiple methods.

Author(s)

Edi Prifti (IRD)

Examples

# Assuming digested.results contains the best cross-validation performance scores for methods
plotComparativeBestCV(digested.results, ylim = c(0.5, 1), score = "auc_", ci = TRUE, main = "Comparison of Best AUC across Methods")

# You can customize the plot by adjusting the score, error bars (ci), and other parameters.


predomics/predomicspkg documentation built on Dec. 11, 2024, 11:06 a.m.