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

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

Arguments

object

A named list of class "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.

Value

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

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.

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

  • "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.

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)
#> $cvRiskByClass #> # A tibble: 3 x 7 #> Estimator Min Q1 Median Q3 Max Mean #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 sampleCovEst 61.0 61.0 61.0 61.0 61.0 61.0 #> 2 linearShrinkEst 59.1 59.4 60.5 68.7 78.2 65.1 #> 3 thresholdingEst 60.7 61.4 61.6 78.0 90.3 70.5 #> #> $bestInClass #> # A tibble: 3 x 3 #> estimator hyperparameter cv_risk #> <chr> <chr> <dbl> #> 1 linearShrinkEst alpha = 0.8 59.1 #> 2 thresholdingEst gamma = 0.3 60.7 #> 3 sampleCovEst hyperparameters = NA 61.0 #> #> $worstInClass #> # A tibble: 3 x 3 #> estimator hyperparameter cv_risk #> <chr> <chr> <dbl> #> 1 sampleCovEst hyperparameters = NA 61.0 #> 2 linearShrinkEst alpha = 0.1 78.2 #> 3 thresholdingEst gamma = 0.9 90.3 #> #> $hyperRisk #> $hyperRisk$linearShrinkEst #> # A tibble: 5 x 3 #> hyperparameters cv_risk stat #> <chr> <chr> <chr> #> 1 alpha = 0.8 59 min #> 2 alpha = 0.8 59 Q1 #> 3 alpha = 0.6 61 median #> 4 alpha = 0.3 69 Q3 #> 5 alpha = 0.1 78 max #> #> $hyperRisk$thresholdingEst #> # A tibble: 5 x 3 #> hyperparameters cv_risk stat #> <chr> <chr> <chr> #> 1 gamma = 0.3 61 min #> 2 gamma = 0.3 61 Q1 #> 3 gamma = 0.4 62 median #> 4 gamma = 0.7 78 Q3 #> 5 gamma = 0.9 90 max #> #>