coef.dcsvm | R Documentation |
Computes the coefficients or indices of nonzero coefficients at specified lambda
values from a fitted dcsvm
model.
## S3 method for class 'dcsvm'
coef(object, s = NULL, type = c("coefficients", "nonzero"), ...)
object |
A fitted |
s |
Value(s) of the L1 tuning parameter |
type |
|
... |
Not used. Other arguments to |
Compute Coefficients for Sparse Density-Convoluted SVM
Computes the coefficients or returns the indices of nonzero coefficients at chosen values of lambda
from a fitted dcsvm
object.
s
is the vector of lambda
values at which predictions are requested. If s
is not in the lambda sequence used for fitting the model, the coef
function uses linear interpolation. The new values are interpolated using a fraction of coefficients from both left and right lambda
indices.
Either the coefficients at the requested values of lambda
, or a list of the indices of the nonzero coefficients for each lambda
.
predict.dcsvm
data(colon)
fit <- dcsvm(colon$x, colon$y, lam2=1)
c1 <- coef(fit, type="coefficients", s=c(0.1, 0.005))
c2 <- coef(fit, type="nonzero")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.