View source: R/predict.sparsenet.R
predict.sparsenet | R Documentation |
Similar to other predict methods, this functions predicts fitted values,
coefficients and more from a fitted "sparsenet"
object.
## S3 method for class 'sparsenet'
predict(object, newx, s = NULL, which.gamma = NULL,
type=c("response","coefficients","nonzero"), exact = FALSE, ...)
## S3 method for class 'sparsenet'
coef(object,s=NULL, which.gamma = NULL,exact=FALSE, ...)
object |
Fitted |
newx |
Matrix of new values for |
s |
Value(s) of the penalty parameter |
which.gamma |
Index or indices of |
type |
|
exact |
By default ( |
... |
Not used. Other arguments to predict. |
The shape of the objects returned depends on which
which.gamma
has more than one element.
If more than one element, a list of predictions is returned, one for
each gamma.
The object returned depends on type.
Rahul Mazumder, Jerome Friedman and Trevor Hastie
Maintainer: Trevor Hastie <hastie@stanford.edu>
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
glmnet
package, sparsenet
, cv.sparsenet
and
print
and plot
methods for both.
x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
fit=sparsenet(x,y)
predict(fit, which.gamma=5,type="nonzero")
predict(fit,x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.