Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Methods_SSI_CV

SSI_CV methods


Description

Useful methods for retrieving, summarizing and visualizing important results from an object of the class 'SSI_CV'

Usage

## S3 method for class 'SSI_CV'
summary(object, ...)

## S3 method for class 'SSI_CV'
plot(..., py=c("accuracy","MSE"), title=NULL, showFolds=FALSE)

Arguments

object

An object of the class 'SSI_CV'

...

Arguments to be passed:

  • Not needed for method summary

  • object: One or more objects of the class 'SSI_CV' (for method plot)

py

(character) Either 'accuracy' or 'MSE' to plot the correlation between observed and predicted values or the mean squared error, respectively, in the y-axis

title

(character/expression) Title of the plot

showFolds

TRUE or FALSE to whether add results for individuals folds

Value

Method summary returns a list object containing:

  • lambda: (matrix) sequence of (average across folds) values of lambda (in columns) used in each CV partition (in rows).

  • df: (matrix) degrees of freedom (average across folds) at each solution associated to each value of lambda for each CV partition (in rows).

  • accuracy: (matrix) correlation between observed and predicted values (average across folds) given by each value of lambda (in columns) in each CV partition (in rows).

  • MSE: (matrix) mean squared error (average across folds) given by each value of lambda (in columns) in each CV partition (in rows).

  • optCOR: (matrix) summary of the SSI with maximum accuracy within and across CV partitions (in rows).

  • optMSE: (matrix) summary of the SSI with minimum MSE within and across CV partitions (in rows).

Method plot creates a plot of either accuracy or MSE versus the (average across folds and partitions) number of predictors (with non-zero regression coefficient) and versus lambda.

Author(s)

Marco Lopez-Cruz (maraloc@gmail.com) and Gustavo de los Campos

Examples

require(SFSI)
  data(wheatHTP)
  
  X = scale(X[1:200,])/sqrt(ncol(X))    # Subset and scale markers
  G = tcrossprod(X)                     # Genomic relationship matrix
  y = as.vector(scale(Y[1:200,"YLD"]))  # Subset response variable
 
  fm1 = SSI_CV(y,K=G,trn=31:length(y),nFolds=5,nCV=1)
  
  out = summary(fm1)    # Useful results
  out$accuracy          # Testing set accuracy (cor(y,yHat))
  out$optCOR            # SSI with maximum accuracy
  out$optMSE            # SSI with minimum MSE
  
  plot(fm1,title=expression('corr('*y[obs]*','*y[pred]*') vs sparsity'))   
  plot(fm1,showFolds=TRUE)

SFSI

Sparse Family and Selection Index

v0.3.0
GPL-3
Authors
Marco Lopez-Cruz [aut, cre], Gustavo de los Campos [aut], Paulino Perez-Rodriguez [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.