predict.glmnetcr: AIC, BIC, Predicted Class, and Fitted Probabilities for All...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/predict.glmnetcr.R

Description

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

Usage

1
2
## S3 method for class 'glmnetcr'
predict(object, newx = NULL, ...)

Arguments

object

a glmnetcr object

newx

a data matrix representing the predictor variables, if missing defaults to original data used in fitting the model

...

additional optional arguments

Value

AIC

a numeric vector representing the AIC for each step

BIC

a numeric vector representing the BIC for each step

class

a matrix with n rows indicating the predicted class for each observation in newx for each stepp

probs

an array where for each step, a matrix of n rows and K columns indicates the fitted class probabilities for each observation and class

Author(s)

Kellie J. Archer, archer.43@osu.edu

See Also

See Also as glmnetcr, fitted.glmnetcr

Examples

1
2
3
4
5
6
data(diabetes)
x <- diabetes[, 2:dim(diabetes)[2]]
y <- diabetes$y
glmnet.fit <- glmnetcr(x, y)
result <- predict(glmnet.fit)
names(result)

Example output

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-12

Warning message:
from glmnet Fortran code (error code -26); Convergence for 26th lambda value not reached after maxit=100 iterations; solutions for larger lambdas returned 
[1] "BIC"   "AIC"   "class" "probs"

glmnetcr documentation built on July 8, 2020, 6:21 p.m.