plotComparativeResults: Plot Comparative Results for Multiple Methods and...

View source: R/global.visu.R

plotComparativeResultsR Documentation

Plot Comparative Results for Multiple Methods and Cross-Validation Scores

Description

This function generates plots comparing multiple performance metrics (such as AUC, accuracy, recall, precision, F1-score, etc.) across different methods. It can display results from both empirical and cross-validation (CV) evaluations, with options to show the best results across methods or by k-sparsity values. The function can handle both classification and regression tasks and supports visualizing both the empirical and generalization performance.

Usage

plotComparativeResults(
  digested.results,
  plot = TRUE,
  ylim = c(0.5, 1),
  best = FALSE,
  ci = FALSE,
  main = "",
  mode = "classification"
)

Arguments

digested.results

A list containing the performance results, including both empirical and cross-validation (CV) scores for various methods.

plot

A logical value ('TRUE' or 'FALSE'). If 'TRUE', the function will generate and display the plots. Default is 'TRUE'.

ylim

A numeric vector of length 2 specifying the limits for the y-axis. Default is 'c(0.5, 1)'.

best

A logical value ('TRUE' or 'FALSE'). If 'TRUE', the function will plot the best results across methods, regardless of the k-sparsity. Default is 'FALSE'.

ci

A logical value ('TRUE' or 'FALSE'). If 'TRUE', confidence intervals (error bars) will be shown in the plots. Default is 'FALSE'.

main

A string specifying the title of the plots. Default is an empty string.

mode

A string specifying the type of model being analyzed. Options are '"classification"' or '"regression"'. Default is '"classification"'.

Details

The function generates multiple plots comparing performance metrics such as AUC, accuracy, recall, precision, F1-score, and correlation, across multiple methods. The plots can show: - Empirical performance for each method. - Cross-validation performance (generalization) for each method. - The best results across methods, either by k-sparsity or regardless of k-sparsity.

The plots are generated using ggplot2 and arranged in a grid using the multiplot function. The user can choose to visualize the results for classification or regression models.

Value

If 'plot = TRUE', the function displays the plots. If 'plot = FALSE', the function returns a list of ggplot objects for further manipulation.

Author(s)

Edi Prifti (IRD)

Examples

# Assuming digested.results contains the performance scores for methods
plotComparativeResults(digested.results, plot = TRUE, ylim = c(0.5, 1),
best = TRUE, ci = TRUE, main = "Comparison of Results")


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