plot.gspcrcv {gspcr}R Documentation

Plot the cross-validation solution path for the GSPCR algorithm

Description

Produces a scatter plot showing the CV score obtained by cv_gspcr (Y-axis) with different threshold values (X-axis) for a different number of components (lines).

Usage

## S3 method for class 'gspcrcv'
plot(
  x,
  y = NULL,
  labels = TRUE,
  errorBars = FALSE,
  discretize = TRUE,
  y_reverse = FALSE,
  print = TRUE,
  ...
)

Arguments

x

An object of class gspcr.

y

The CV fit measure to report on the Y axis. Default is the fit measure specified in cv_gspcr().

labels

Logical value. FALSE hides the labels of the points indicating the number of components used. The default is TRUE.

errorBars

Logical value. TRUE shows the error bars for each point. The default is FALSE.

discretize

Logical value. TRUE treats the X-axis as a discrete measure that facilitates comparing solution paths between different fit measures. The default is TRUE.

y_reverse

Logical value. TRUE reverses the y axis scale. The default is FALSE.

print

Logical value. TRUE prints the plot when the function is called. The default is TRUE.

...

Other arguments passed on to methods. Not currently used.

Details

The bounds defining the error bars are computed by cv_gspcr(). First, the K-fold cross-validation score of the statistic of interest (e.g., the F score, the MSE) is computed. Then, the standard deviation of the statistic across the K folds is computed. Finally, the bounds used for the error bars are computed by summing and subtracting this standard deviation to and from the K-fold cross-validation score of the statistic.

Reversing the y-axis with y_reverse can be helpful to compare results obtained by different fit measures.

Value

A scatter plot of ggplot class

Author(s)

Edoardo Costantini, 2023


[Package gspcr version 0.9.5 Index]