Learn R Programming

sparseSVM (version 1.1-7)

sparseSVM-package: Solution Paths for Sparse High-dimensional Support Vector Machine with Lasso or Elastic-Net Regularization

Description

Fast algorithm for fitting solution paths for sparse SVM regularized by lasso or elastic-net that generate sparse solutions.

Arguments

Author

Congrui Yi and Yaohui Zeng
Maintainer: Congrui Yi <eric.ycr@gmail.com>

Details

Package:sparseSVM
Type:Package
Version:1.1-7
Date:2024-09-23
License:GPL-3

Accepts X,y data for binary classification and produces the solution path over a grid of values of the regularization parameter lambda. Also provides functions for plotting, prediction and parallelized cross-validation.

References

Yi, C. and Huang, J. (2017) Semismooth Newton Coordinate Descent Algorithm for Elastic-Net Penalized Huber Loss Regression and Quantile Regression, tools:::Rd_expr_doi("10.1080/10618600.2016.1256816")
Journal of Computational and Graphical Statistics

Examples

Run this code
X = matrix(rnorm(1000*100), 1000, 100)
b = 3
w = 5*rnorm(10)
eps = rnorm(1000)
y = sign(b + drop(X[,1:10] %*% w + eps))

fit = sparseSVM(X, y)
coef(fit, 0.05)
predict(fit, X[1:5,], lambda = c(0.2, 0.1))
plot(fit)

cv.fit <- cv.sparseSVM(X, y, ncores = 2, seed = 1234)
predict(cv.fit, X)
coef(cv.fit)
plot(cv.fit)

Run the code above in your browser using DataLab