summary.cvCovEst: Generic Summary Method for cvCovEst

View source: R/summary_functions.R

summary.cvCovEstR Documentation

Generic Summary Method for cvCovEst

Description

summary() provides summary statistics regarding the performance of cvCovEst() and can be used for diagnostic plotting.

Usage

## S3 method for class 'cvCovEst'
summary(
  object,
  dat_orig,
  summ_fun = c("cvRiskByClass", "bestInClass", "worstInClass", "hyperRisk"),
  ...
)

Arguments

object

A named list of class "cvCovEst".

dat_orig

The numeric data.frame, matrix, or similar object originally passed to cvCovEst().

summ_fun

A character vector specifying which summaries to output. See Details for function descriptions.

...

Additional arguments passed to summary()These are not explicitly used and should be ignored by the user.

Details

summary() accepts four different choices for the summ_fun argument. The choices are:

  • "cvRiskByClass" - Returns the minimum, first quartile, median, third quartile, and maximum of the cross-validated risk associated with each class of estimator passed to cvCovEst().

  • "bestInClass" - Returns the specific hyperparameters, if applicable, of the best performing estimator within each class along with other metrics.

  • "worstInClass" - Returns the specific hyperparameters, if applicable, of the worst performing estimator within each class along with other metrics.

  • "hyperRisk" - For estimators that take hyperparameters as arguments, this function returns the hyperparameters associated with the minimum, first quartile, median, third quartile, and maximum of the cross-validated risk within each class of estimator. Each class has its own tibble, which are returned as a list.

Value

A named list where each element corresponds to the output of of the requested summaries.

Examples

cv_dat <- cvCovEst(
  dat = mtcars,
  estimators = c(
    linearShrinkEst, thresholdingEst, sampleCovEst
  ),
  estimator_params = list(
    linearShrinkEst = list(alpha = seq(0.1, 0.9, 0.1)),
    thresholdingEst = list(gamma = seq(0.1, 0.9, 0.1))
  ),
  center = TRUE,
  scale = TRUE
)

summary(cv_dat, mtcars)

cvCovEst documentation built on May 29, 2024, 5:51 a.m.