Learn R Programming

glmnetcr (version 1.0.2)

fitted.glmnet.cr: AIC, BIC, Predicted Class, and Fitted Probabilities of Class Membership

Description

For a given step, returns the AIC, BIC, predicted class, and the fitted probabilities for the K classes.

Usage

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

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
s
the step at which the fitted probabilities and class are desired
...
additional optional arguments

Value

  • AICAIC at step s
  • BICBIC at step s
  • classa vector of length n indicating the predicted class for each observation in newx at step s
  • probsa matrix with n rows and K columns indicating the fitted class probabilities for each observation and class in new at step x

See Also

See Also as predict.glmnet.cr, select.glmnet.cr

Examples

Run this code
data(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