predict.dcsvm | R Documentation |
Predicts binary class labels or fitted values for a dcsvm
model using new data.
## S3 method for class 'dcsvm'
predict(object, newx, s = NULL, type = c("class", "link"), ...)
object |
A fitted |
newx |
A matrix of new values for |
s |
Value(s) of the L1 tuning parameter |
type |
|
... |
Not used. Other arguments to |
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.
Returns either the predicted class labels or the fitted values, depending on the choice of type
.
coef.dcsvm
data(colon)
fit <- dcsvm(colon$x, colon$y, lam2=1)
print(predict(fit, type="class", newx=colon$x[2:5, ]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.