coef.dcsvm: Compute Coefficients for Sparse Density-Convoluted SVM
Description
Computes the coefficients or indices of nonzero coefficients at specified lambda values from a fitted dcsvm model.
Usage
# S3 method for dcsvm
coef(object, s = NULL, type = c("coefficients", "nonzero"), ...)
Value
Either the coefficients at the requested values of lambda, or a list of the indices of the nonzero coefficients for each lambda.
Arguments
object
A fitted dcsvm object.
s
Value(s) of the L1 tuning parameter lambda for computing coefficients. Default is the entire lambda sequence obtained by dcsvm.
type
"coefficients" or "nonzero"? "coefficients" computes the coefficients at given values for s; "nonzero" returns a list of the indices of the nonzero coefficients for each value of s. Default is "coefficients".
...
Not used. Other arguments to predict.
Details
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.