Learn R Programming

glmnetcr (version 1.0.2)

predict.glmnet.cr: AIC, BIC, Predicted Class, and Fitted Probabilities for All Models

Description

Returns the AIC, BIC, predicted class, and the fitted probabilities for the K classes for all steps along the path.

Usage

## S3 method for class 'glmnet.cr':
predict(object, newx = NULL, ...)

Arguments

object
a glmnet.cr object
newx
a data matrix representing the predictor variables, if missing defaults to original data used in fitting the model
...
additional optional arguments

Value

  • AICa numeric vector representing the AIC for each step
  • BICa numeric vector representing the BIC for each step
  • classa matrix with n rows indicating the predicted class for each observation in newx for each stepp
  • probsan array where for each step, a matrix of n rows and K columns indicates the fitted class probabilities for each observation and class

See Also

See Also as glmnet.cr, fitted.glmnet.cr

Examples

Run this code
data(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
glmnet.fit <- glmnet.cr(x, y)
result <- predict(glmnet.fit)
names(result)

Run the code above in your browser using DataLab