predict.cv.sparsenet {sparsenet} | R Documentation |
make predictions from a "cv.sparsenet" object.
Description
This function makes predictions from a cross-validated sparsenet model,
using the stored "sparsenet.fit"
object, and the optimal value
chosen for lambda
.
Usage
## S3 method for class 'cv.sparsenet'
predict(object, newx, which=c("parms.min","parms.1se"),...)
## S3 method for class 'cv.sparsenet'
coef(object, which=c("parms.min","parms.1se"),...)
Arguments
object |
Fitted |
newx |
Matrix of new values for |
which |
Either the paramaters of the minimum of the CV curves
(default |
... |
Not used. Other arguments to predict. |
Details
This function makes it easier to use the results of cross-validation to make a prediction.
Value
The object returned depends the ... argument which is passed on
to the predict
method for sparsenet
objects.
Author(s)
Rahul Mazumder, Jerome Friedman and Trevor Hastie
Maintainer: Trevor Hastie <hastie@stanford.edu>
References
Mazumder, Rahul, Friedman, Jerome and Hastie, Trevor (2011) SparseNet: Coordinate Descent with Nonconvex Penalties. JASA, Vol 106(495), 1125-38, https://hastie.su.domains/public/Papers/Sparsenet/Mazumder-SparseNetCoordinateDescent-2011.pdf
See Also
glmnet
package, sparsenet
, cv.sparsenet
and
print
and plot
methods for both.
Examples
x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
fitcv=cv.sparsenet(x,y)
predict(fitcv,x)