plot.cval: Plot for cross-validation

View source: R/plot.cval.R

plot.cvalR Documentation

Plot for cross-validation

Description

Plot a cross-validation object (tuning RGCA parameters in 'supervised' mode). The parameters tuned for maximizing the cross-validation metric is displayed in the title. On the y-axis, the tuning parameter set. On the x-axis, a boxplot of the cross-validation metric.

Usage

## S3 method for class 'cval'
plot(
  x,
  type = "sd",
  cex = 1,
  cex_main = 14 * cex,
  cex_sub = 12 * cex,
  cex_point = 3 * cex,
  cex_lab = 12 * cex,
  display_order = TRUE,
  ...
)

Arguments

x

A rgcca_cv object (see rgcca_cv)

type

Character string indicating the statistics in the box plots:

  • "sd" (default): the middle bar corresponds to the mean and limits of the boxes are given by the mean plus or minus the standard deviation.

  • "quantile": the middle bar corresponds to the median and limits of the boxes are given by the 25

cex

A numeric defining the size of the objects in the plot. Default is one.

cex_main

A numeric defining the font size of the title. Default is 14 * cex.

cex_sub

A numeric defining the font size of the subtitle. Default is 12 * cex.

cex_point

A numeric defining the font size of the points. Default is 3 * cex.

cex_lab

A numeric defining the font size of the labels. Default is 12 * cex.

display_order

A logical value for ordering the variables. If TRUE, variables are ordered from highest to lowest absolute value. If FALSE, the block order is used. Default is TRUE.

...

Additional graphical parameters.

Value

A ggplot2 plot object.

Examples

data("Russett")
blocks <- list(
  agriculture = Russett[, seq(3)],
  industry = Russett[, 4:5],
  politic = Russett[, 6:8]
)
res <- rgcca_cv(blocks,
  response = 3, method = "rgcca", par_type = "tau",
  par_value = c(0, 0.2, 0.3), n_run = 1, n_cores = 1
)
plot(res)

Tenenhaus/RGCCA documentation built on March 16, 2023, 2:04 p.m.