predict.srm | R Documentation |
Predicts response for a given sample
## S3 method for class 'srm'
predict(object, newx, lambda = NULL, gamma = NULL, ...)
## S3 method for class 'srm_cv'
predict(object, newx, lambda = NULL, gamma = NULL, ...)
object |
The output of fit_sparse_regression. |
newx |
A matrix on which predictions are made. The matrix should have p columns |
lambda |
The value of lambda to use for prediction.
A summary of the lambdas in the regularization path can be obtained using |
gamma |
The value of gamma to use for prediction.
A summary of the gammas in the regularization path can be obtained using |
... |
Other parameters |
If both lambda and gamma are not supplied, then a matrix of predictions for all the solutions in the regularization path is returned. If lambda is supplied but gamma is not, the smallest value of gamma is used. In case of logistic regression, probability values are returned.
Return predict value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.