Description Usage Arguments Details Value Author(s) References Examples
Solves a kernelized Support Vector Machine in the case where the kernel used may not be positive semidefinite.
1 2 3 4 5 6 7 8 9 10 11 12 |
kernelmat |
the kernel matrix computed for all observations |
y |
a vector of labels |
cost |
cost of violating the constraint |
class.weights |
a named vector of weights for the different classes, used for asymmetric class sizes. Not all factor levels have to be supplied (default weight: 1). All components have to be named. Specifying "inverse" will choose the weights inversely proportional to the class distribution. |
cross |
number of fold in a k-fold cross validation |
probability |
logical indicating whether the model should allow for probability predictions (default: |
fitted |
logical indicating whether the fitted values should be computed and included in the model or not (default: |
subset |
an index vector specifying the cases to be used in the training sample. (NOTE: If given, this argument must be named.) |
... |
additional parameters |
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.
An object of class krein.svm containing the fitted model, including:
SVa matrix containing the Support Vectors
indexindex of the resulting support vectors in the data matrix
coefsa matrix containing corresponding coefficients times the training labels
rhovalue of the (negative) intercept
Tullia Padellini, Francesco Palini, David Meyer. The included C++ library LIBSVM is authored by Chih-Chung Chang and Chih-Jen Lin)
loosli2015learningkernelTDA
\insertRefchang2011libsvmkernelTDA
\insertRefdimitriadou2008misckernelTDA
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## DO NOT RUN:
# 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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.