predict.dcsvm {dcsvm} | R Documentation |
Make Predictions for Sparse Density-Convoluted SVM
Description
Predicts binary class labels or fitted values for a dcsvm
model using new data.
Usage
## S3 method for class 'dcsvm'
predict(object, newx, s = NULL, type = c("class", "link"), ...)
Arguments
object |
A fitted |
newx |
A matrix of new values for |
s |
Value(s) of the L1 tuning parameter |
type |
|
... |
Not used. Other arguments to |
Details
Make Predictions for Sparse Density-Convoluted SVM
This function predicts the binary class labels or the fitted values of a dcsvm
object.
s
represents the new lambda
values for making predictions. If s
is not part of the original lambda
sequence generated by dcsvm
, predict.dcsvm
uses linear interpolation to compute predictions by combining adjacent lambda
values in the original sequence. This functionality is adapted from the predict
methods in the glmnet
and gcdnet
packages.
Value
Returns either the predicted class labels or the fitted values, depending on the choice of type
.
See Also
Examples
data(colon)
fit <- dcsvm(colon$x, colon$y, lam2=1)
print(predict(fit, type="class", newx=colon$x[2:5, ]))