krein.svm: Krein Support Vector Machine

Description Usage Arguments Details Value Author(s) References Examples

Description

Solves a kernelized Support Vector Machine in the case where the kernel used may not be positive semidefinite.

Usage

1
krein.svm(kernelmat, ...)

Arguments

kernelmat

the kernel matrix computed for all observations

...

additional parameters, see krein.svm.default for more details on how to use this function

Details

This function implements the Krein Support Vector Machine solver as defined by Loosli et al. (2015). The implementation of the solver is a modified version of the popular C++ library 'LIBSVM', while the connection to 'R' heavily relies on the 'R'-package e1701.

Value

An object of class krein.svm containing the fitted model, including:

SV

a matrix containing the Support Vectors

index

index of the resulting support vectors in the data matrix

coefs

a matrix containing corresponding coefficients times the training labels

rho

value of the (negative) intercept

Author(s)

Tullia Padellini, Francesco Palini, David Meyer. The included C++ library LIBSVM is authored by Chih-Chung Chang and Chih-Jen Lin)

References

\insertRef

loosli2015learningkernelTDA

\insertRef

chang2011libsvmkernelTDA

\insertRef

dimitriadou2008misckernelTDA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(TDA)
set.seed(123)
foo.data = list()
for(i in 1:20){
foo = circleUnif(100)
foo.data[[i]] = ripsDiag(foo, 1,1)$diagram}
for(i in 21:40){
foo = cbind(runif(100), runif(100))
foo.data[[i]] = ripsDiag(foo, 1,1)$diagram
}
GSWkernel = gaus.kernel(foo.data, h =1, dimension = 1,  q = 2)
GGKclass = krein.svm(kernelmat = GSWkernel, y = rep(c(1,2), c(20,20)))

kernelTDA documentation built on April 19, 2020, 3:56 p.m.