R: Glmnet Prediction Using CVAV.

glmnetPredict {bestglm} | R Documentation

## Glmnet Prediction Using CVAV.

### Description

Predict by averaging the predictions from cv.glmnet().

### Usage

    glmnetPredict(XyList, NREP = 15, alpha = 0, nfolds=10,
     family = c("gaussian", "binomial", "poisson", "multinomial"))

### Arguments

`XyList` | list with components XyTr, XTr, yTr, XTe.
`NREP` | number of replications to use in average
`alpha` | elastic net parameter
`nfolds` | Number of folds, K, in regularized K-fold CV, must be >3 and <=10.
`family` | model

### Value

vector with predictions

### Author(s)

A. I. McLeod

### See Also

`trainTestPartition`, `glmnetGridTable`, `glmnet`, `cv.glmnet`, `predict.glmnet`

### Examples

    set.seed(7733551)
    out <- trainTestPartition(mcdonald)
    round(glmnetGridTable(out),4)
    yh <- glmnetPredict(out, NREP=5)
    sqrt(mean((out$yTe - yh)^2))

[Package bestglm version 0.36 Index]