dcsvm | R Documentation |
Fits the density-convoluted support vector machine (DCSVM) through kernel density convolutions.
dcsvm(
x,
y,
nlambda = 100,
lambda.factor = ifelse(nobs < nvars, 0.01, 1e-04),
lambda = NULL,
lam2 = 0,
kern = c("gaussian", "uniform", "epanechnikov"),
hval = 1,
pf = rep(1, nvars),
pf2 = rep(1, nvars),
exclude,
dfmax = nvars + 1,
pmax = min(dfmax * 1.2, nvars),
standardize = TRUE,
eps = 1e-08,
maxit = 1e+06,
istrong = TRUE
)
x |
A numeric matrix with |
y |
A numeric vector of length |
nlambda |
Number of |
lambda.factor |
Ratio of the smallest to the largest |
lambda |
An optional user-specified sequence of |
lam2 |
Users may tune |
kern |
Type of kernel method for smoothing. Options are |
hval |
The bandwidth parameter for kernel smoothing. Default is 1. |
pf |
A numeric vector of length |
pf2 |
A numeric vector of length |
exclude |
Indices of predictors to exclude from the model. Equivalent to assigning an infinite penalty factor. Default is none. |
dfmax |
Maximum number of nonzero coefficients allowed in the model. Default is |
pmax |
Maximum number of variables allowed to ever be nonzero during the computation. Default is |
standardize |
Logical indicating whether predictors should be standardized to unit variance. Default is |
eps |
Convergence threshold. The algorithm stops when |
maxit |
Maximum number of iterations allowed. Default is |
istrong |
Logical indicating whether to use the strong rule for faster computation. Default is |
An object of class dcsvm
containing the following components:
b0 |
Intercept values for each |
beta |
Sparse matrix of coefficients for each |
df |
Number of nonzero coefficients for each |
dim |
Dimensions of the coefficient matrix. |
lambda |
Sequence of |
npasses |
Total number of iterations across all |
jerr |
Warnings and errors. 0 if no errors. |
call |
The matched call. |
print.dcsvm
, predict.dcsvm
, coef.dcsvm
, plot.dcsvm
, and cv.dcsvm
.
# Load the data
data(colon)
# Fit the elastic-net penalized DCSVM with lambda2 to be 1
fit <- dcsvm(colon$x, colon$y, lam2 = 1)
print(fit)
# Coefficients at some lambda value
c1 <- coef(fit, s = 0.005)
# Make predictions
predict(fit, newx = colon$x[1:10, ], s = c(0.01, 0.005))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.