powered by
Predict by averaging the predictions from cv.glmnet().
glmnetPredict(XyList, NREP = 15, alpha = 0, nfolds=10, family = c("gaussian", "binomial", "poisson", "multinomial"))
list with components XyTr, XTr, yTr, XTe.
number of replications to use in average
elastic net parameter
Number of folds, K, in regularized K-fold CV, must be >3 and <=10.
model
vector with predictions
trainTestPartition, glmnetGridTable, glmnet, cv.glmnet, predict.glmnet
trainTestPartition
glmnetGridTable
glmnet
cv.glmnet
predict.glmnet
# NOT RUN { set.seed(7733551) out <- trainTestPartition(mcdonald) round(glmnetGridTable(out),4) yh <- glmnetPredict(out, NREP=5) sqrt(mean((out$yTe - yh)^2)) # }
Run the code above in your browser using DataLab