Description Usage Arguments Value Author(s) See Also Examples
View source: R/glmnetPredict.R
Predict by averaging the predictions from cv.glmnet().
1 2 | glmnetPredict(XyList, NREP = 15, alpha = 0, nfolds=10,
family = c("gaussian", "binomial", "poisson", "multinomial"))
|
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 |
vector with predictions
A. I. McLeod
trainTestPartition
,
glmnetGridTable
,
glmnet
,
cv.glmnet
,
predict.glmnet
1 2 3 4 5 | set.seed(7733551)
out <- trainTestPartition(mcdonald)
round(glmnetGridTable(out),4)
yh <- glmnetPredict(out, NREP=5)
sqrt(mean((out$yTe - yh)^2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.