Skip to content

YikaiZhang95/hdsvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hdsvm

hdsvm is an R package for high-dimensional support vector machines. It is especially useful for classification problems where the number of features is much larger than the number of samples, such as in gene expression datasets.

This README shows basic usage examples based on the official vignette.

Introduction

This package provides tools for fitting the penalized SVM.

The strengths and improvements that this package offers relative to other SVM packages are as follows:

  • Compiled Fortran code significantly speeds up the penalized SVM estimation process.

  • Solve the elastic net penalized SVM using generalized coordinate descent algorithm.

  • Active-set and warm-start strategies implemented to compute the solution path as $\lambda_1$ varies.

Then the penalized SVM model is formulated as:

penalized SVM

where the ∘ symbol represents the Hadamard (element-wise) product.

Installation

install.packages("hdsvm")

Usage

library(hdsvm)
set.seed(315)
n <- 100
p <- 400
x1 <- matrix(rnorm(n / 2 * p, -0.25, 0.1), n / 2)
x2 <- matrix(rnorm(n / 2 * p, 0.25, 0.1), n / 2)
x <- rbind(x1, x2)
beta <- 0.1 * rnorm(p)
prob <- plogis(c(x %*% beta))
y <- 2 * rbinom(n, 1, prob) - 1

About

Fast Algorithm for Support Vector Machine

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published