Search code examples
rlogistic-regressionglmnet

How are the predictions obtained?


I have been unable to find information on how exactly predict.cv.glmnet works.

Specifically, when a prediction is being made are the predictions based on a fit that uses all the available data? Or are predictions based on a fit where some data has been discarded as part of the cross validation procedure when running cv.glmnet?

I would strongly assume the former but was unable to find a sentence in the documentation that clearly states that after a cross validation is finished, the model is fitted with all available data for a new prediction.

If I have overlooked a statement along those lines, I would also appreciate a hint on where to find this.

Thanks!


Solution

  • In the documentation for predict.cv.glmnet :

    "This function makes predictions from a cross-validated glmnet model, using the stored "glmnet.fit" object ... "

    In the documentation for cv.glmnet (under value):

    "glmnet.fit a fitted glmnet object for the full data."