get_measure {spareg}R Documentation

Extractor for (cross-)validation measure from 'spar' or 'spar.cv' object

Description

Extractor for (cross-)validation measure from 'spar' or 'spar.cv' object

Usage

get_measure(object)

Arguments

object

A fitted 'spar' or 'spar.cv' model

Value

data.frame containing the (cross-)validation measure for the considered threshold and number of model combinations. For 'spar' objects it contains information about the measure calculated on the validation set (or on the training sample if xval and yval are missing) and the number of active variables. For 'spar.cv' objects it contains information on the average measure obtained across folds together with the standard deviation across the folds and the average number of active variables. the nfolds of the training set.

See Also

spar, spar.cv, get_model

Examples

example_data <- simulate_spareg_data(n = 100, p = 400, ntest = 100)
spar_res <- spar(example_data$x, example_data$y, xval = example_data$xtest,
  yval = example_data$ytest, nummods=c(5, 10, 15, 20, 25, 30))
get_measure(spar_res)


[Package spareg version 1.1.0 Index]