ensr: Elastic Net SearcheR

Description Usage Arguments

View source: R/ensr.R

Description

Search a grid of values of alpha and lambda for minimum mean CV error

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ensr(
  x,
  y,
  alphas = seq(0, 1, length = 10),
  nlambda = 100L,
  standardize = TRUE,
  nfolds = 10L,
  foldid,
  envir = parent.frame(),
  ...
)

Arguments

x

x matrix as in glmnet.

y

response y as in glmnet.

alphas

a sequence of alpha values

nlambda

The number of lambda values - default is 100.

standardize

Logical flag for x variable standardization, prior to fitting the model sequence. The coefficients are always returned on the original scale. Default is standardize=TRUE. If variables are in the same units already, you might not wish to standardize. See details below for y standardization with family="gaussian".

nfolds

number of folds - default is 10. Although nfolds can be as large as the sample size (leave-one-out CV), it is not recommended for large datasets. Smallest value allowable is nfolds=3

foldid

an optional vector of values between 1 and nfold identifying what fold each observation is in. If supplied, nfold can be missing.

envir

environment in which to evaluate a cv.glmnet call

...

Other arguments that can be passed to glmnet


dewittpe/ensr documentation built on March 6, 2020, 5:24 p.m.