coef.cv.dcsvm: Compute Coefficients from a "cv.dcsvm" Object
Description
Computes the coefficients at specified lambda values for a cv.dcsvm object.
Usage
# S3 method for cv.dcsvm
coef(object, s = c("lambda.1se", "lambda.min"), ...)
Value
The returned object depends on the choice of s and any additional arguments passed to the dcsvm method.
Arguments
object
A fitted cv.dcsvm object, obtained by conducting cross-validation on the sparse density-convoluted SVM model.
s
Value(s) of the L1 tuning parameter lambda for computing coefficients. Default is "lambda.1se", the largest lambda value achieving a cross-validation error within one standard error of the minimum. Alternatively, "lambda.min" corresponds to the lambda incurring the least cross-validation error. s can also be numeric, specifying the value(s) to use.
...
Other arguments that can be passed to dcsvm.
Details
Compute Coefficients from a "cv.dcsvm" Object
Computes coefficients at chosen values of lambda from the cv.dcsvm object.
This function computes the coefficients for lambda values suggested by cross-validation.
data(colon)
colon$x <- colon$x[ ,1:100] # Use only the first 100 columns for this exampleset.seed(1)
cv <- cv.dcsvm(colon$x, colon$y, lam2=1, nfolds=5)
c1 <- coef(cv, s="lambda.1se")