glmnet.cr(x, y, method = "backward", weights, offset = NULL, alpha = 1,
nlambda = 100, lambda.min.ratio = NULL, lambda = NULL, standardize = TRUE,
thresh = 1e-04, exclude, penalty.factor = NULL, maxit = 100)"dgCMatrix" as in package Matrix)nobs that is included in the linear predictor (a nobs x nc matrix for the "multinomial" family). Useful for the "poisson" family (e.g. log of exposure time), or for refining a model byalpha=1
is the lasso penalty.\alpha\le>lambda values - default is 100.lambda, as a fraction of
lambda.max, the (data derived) entry value (i.e. the smallest
value for which all coefficients are zero). The default depends on the
sample size nobs relative to thlambda sequence. Typical usage
is to have the
program compute its own lambda sequence based on
nlambda and lambda.min.ratio. Supplying a value of
lambda overstandardize=TRUE.
If variables are in the same units already, you might not wish thresh
times the null deviance. Defaults value is 1E-6<lambda to allow
differential shrinkage. Can be 0 for some variables, which implies
no shrinkage, and that variable is always included in"binomial" or "multinomial" families. Default is 100.length(lambda)nvars x
length(lambda) matrix of coefficientslambda values used"elnet", this
is the R-square). The deviance calculations incorporate weights if
present in the model. The deviance is defined to be -2*(loglike_sat -
loglike), where loglike_sat is the log-likelihood for the saturated
model (a model with a free parameter per observation). Hence dev.fraction=1-dev/nulldev.lambda."multnet" only so does not apply to the CR model. A matrix consisting of the
number of nonzero coefficients per classpredict and fitted functionspredict and fitted functionspredict and fitted functionslambda is fit by coordinate
descent. This is a lasso or elasticnet regularization path
for fitting the generalized linear regression
paths, by maximizing the appropriate penalized log-likelihood. Sometimes the sequence is truncated before nlambda
values of lambda have been used, because of instabilities in
the inverse link functions near a saturated fit. This function invokes glmnet(...,family="binomial")
which fits a traditional logistic regression model for the
log-odds. The
penalties take care of redundancies.glmnet, select.glmnet.cr, fitted.glmnet.crdata(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
glmnet.fit <- glmnet.cr(x, y)
fitted(glmnet.fit, s = select.glmnet.cr(glmnet.fit))Run the code above in your browser using DataLab