Extracts coefficients from outer CV glmnet models from a nestcv.glmnet
fitted object.
cv_coef(x, level =1)
Arguments
x: a nestcv.glmnet fitted object
level: For multinomial models only, either an integer specifying which level of outcome is being examined, or the level can be specified as a character value
Returns
matrix of coefficients from outer CV glmnet models plus the final glmnet model. Coefficients for variables which are not present in a particular outer CV fold model are set to 0.