net_args: glmnet arguments helper function

Description Usage Arguments Value Examples

View source: R/scrimp.R

Description

glmnet arguments helper function

Usage

1
2
3
4
5
6
7
8
9
net_args(
  alpha = 1/2,
  cmplx = "lambda.1se",
  weights = NULL,
  foldid = NULL,
  nfolds = 10,
  keep_mdl = FALSE,
  keep_prd = TRUE
)

Arguments

alpha

the elastic net mixing parameter

cmplx

Value(s) of the penalty parameter lambda at which predictions are required. Default is the value s = "lambda.1se" stored on the CV object. Alternatively s = "lambda.min" can be used. If s is numeric, it is taken as the value(s) of lambda to be used. (For historical reasons the glmnet authors use the symbol 's' to reference this parameter)

weights

observation weights. Default is 1 for each observation

foldid

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

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

keep_mdl

a logical value. If TRUE, then the output of scrimp_mdl will include the glmnet model object. Default is FALSE

keep_prd

a logical value. If TRUE, then the output of scrimp_mdl will include predictions from the glmnet model object. Default is TRUE

Value

a named list with arguments that should be passed into the .fun_args argument of scrimp_mdl.

Examples

1
2
3
net_args()

net_args(cmplx = 'lambda.min')

bcjaeger/midy documentation built on May 3, 2020, 3:55 p.m.