staticdocs/prepackagedwrappers.md

Prepackaged Wrappers

SVMBridge comes with a couple of wrappers for different SVM packages. Here we list these and provide a few details on how to use them.

WARNING: Not all features for each solver are supported yet!

|Short name | Full name | Notes | Data Formats | URL | |-|-|-|-| |BSGD| Budgeted SGD | m | S | http://www.dabi.temple.edu/budgetedsvm/ |BVM| Ball Vector Machine | m | S | http://c2inet.sce.ntu.edu.sg/ivor/cvm.html |CVM| Core Vector Machine | m | S | http://c2inet.sce.ntu.edu.sg/ivor/cvm.html |LASVM | | b | S,p,b | http://leon.bottou.org/projects/lasvm |LIBSVM | | m | S | https://www.csie.ntu.edu.tw/~cjlin/libsvm/ |LLSVM| Low-rank linearization SVM | b | S | http://www.dabi.temple.edu/budgetedsvm/ |SVMperf| | b | S | https://www.cs.cornell.edu/people/tj/svm_light/svm_perf.html

Legend: m = multiclass, b = binary -- S = LIBSVM sparse format, p = split files, b = binary files

Warning: Currently we do not seek completeness. The SVMBridge is a classification-only package, so many options e.g. regarding regression etc. are currently not supported. Some other options, although they can be used with classifications, might be missing too. In case you are missing something, you will need to adapt an existing classifier or simply write your own from scratch. Either way, please share your results with us, so we can include these in future versions of the SVMBridge.

Note: For convenience, all the wrappers are installed along the package and can be accessed by specifying the wrapper folder in the path of the installed SVMBridge. See the introduction for examples on how to do this.

Note: For convenience, all the source code of the prepackaged SVM solvers are also on our github repository. You can also download the versions we used from there: SVMBridge github repository

General Comments

Though some of the solvers, e.g. LLSVM and BSGD, are part of the very same package and at times share the same models, data set format, parameters and executables, the philosophy of the SVMBridge is to have a separate wrapper for each method.

In case you want to use one of the prepackaged wrappers, you simply can add the wrapper by not specifying the wrapperPath. By default, the SVMBridge will try to find the wrapper in the path specified, but if this does not work, it will fallback to the path of the prepackaged wrappers. Alternatively, you can specify the path by hand:

library(SVMBridge)
addSVMPackage("LASVM", file.path (path.package("SVMBridge"), "wrapper"))

After that you can add the path of the compiled software.

LIBSVM

LIBSVM is practically the de-facto standard SVM solver. The wrapper currently supports classification and RBF kernel only.

createTrainingArguments.LIBSVM = function (x,
        ...,
        trainDataFile = "",
        modelFile = "",
        extraParameter = "",
        kernelCacheSize = 1024,
        cost = 1,
        svmType = "-1",
        useBias = FALSE,
        gamma = 1,
        epsilon = 0.001,
        degree = -1,
        coef0 = -1,
        nu = -1,
        shrinking = -1,
        probabilityEstimates = -1,
        weight = -1,
        n = -1,
        kernelType = "rbf",
        quietMode = FALSE)

LASVM

LASVM is very similar to LIBSVM, as both packages use the same parameters and the same model. LASVM has many more options than LIBSVM, as for our purpose we did not need them, for now these are not supported.

createTrainingArguments.LASVM = function (x,
      trainDataFile = "",
      modelFile = "",
      extraParameter = "",
      kernelCacheSize = 1024,
      cost = 1,
      useBias = FALSE,
      gamma = 1,
      epochs = 1,
      epsilon = 0.001,
      ...)

LLSVM

LLSVM is simple way to put the data set into a low dimensional (approximated) feature space and do linear classification there.

Because of this, he models saved by LLSVM are quite non-standard, as the transformation matrices have to be saved instead of a list of support vectors. The prepackaged wrapper includes a simple model reader and writer, both of which are written in pure R. Therefore, the performance of this wrapper is rather reduced. In case you need faster model readers/writers, you need to handle it by yourself.

createTrainingArguments.LLSVM = function (x,
        trainDataFile = "",
        modelFile = "",
        extraParameter = "",
        cost = 1,
        gamma = 1,
        rank = 128, ...)

Budgeted SGD

BSGD is a simple stochastic gradient descent solver with an additional constraint on the number of support vectors. BSGD saves its model in a non-LIBSVM format. The prepackaged wrapper includes a simple model reader and writer, both of which are written in pure R. Therefore, the performance of this wrapper is rather reduced. In case you need faster model readers/writers, you need to handle it by yourself.

createTrainingArguments.BSGD = function (x,
        trainDataFile = "",
        modelFile = "",
        extraParameter = "",
        cost = 1,
        gamma = 1,
        budget = 128,
        epochs = 1, ...)

SVMperf

SVMperf has a great deal of options, so instead of providing all of these as parameter, we decided instead to give the user a choice over several 'configurations'. These are Nystrom, Cholesk, vanilla, CPSP_w3 and CPSP. By default, CPSP is used. You can overwrite the configuration by passing the parameter 'submethod' to the wrapper. In case you need a different setup, you should adapt the wrapper to your needs. Alternatively you may pass your parameters via the 'extraParameters' option and (hopefully) override the options set by one of the methods above.

Note: Please do not mix up SVMperf with SVMlight or SVMRank.

Note: The original binaries, when called without or with wrong options, will wait for a key press. To circumvent this, we grep for identification strings inside the binary file. Therefore, your compiler should not compress the binary.

createTrainingArguments.SVMperf = function (x,
        trainDataFile = "",
        modelFile = "",
        kernelCacheSize = 1024,
        cost = 1,
        gamma = 1,
        k = 1000,
        epsilon = 0.001,
        extraParameter,
        verbose = FALSE,
        ...)

CVM

CVM is an improvement of BVM, and works (technically) very similar to LIBSVM, so the wrapper uses all the read/write model/dataset methods of LIBSVM.

Note: The source code for BVM cannot be found in the internet anymore. Therefore we provide a copy of it in our github repository, see above.

createTrainingArguments.CVM = function (x,
        trainDataFile = "",
        modelFile = "",
        extraParameter = "",
        primalTime = 10,
        wallTime = 8*60,
        kernelCacheSize = 1024,
        cost = 1,
        gamma = 1,
        epsilon = 0.001, ...)

BVM

BVM is a different, geometric way to solve the SVM problem, and works (technically) very similar to LIBSVM, so the wrapper uses all the read/write model/dataset methods of LIBSVM.

Note: The source code for BVM cannot be found in the internet anymore. Therefore we provide a copy of it in our github repository, see above.

createTrainingArguments.BVM = function (x,
        trainDataFile = "",
        modelFile = "",
        extraParameter = "",
        primalTime = 10,
        wallTime = 8*60,
        kernelCacheSize = 1024,
        cost = 1,
        gamma = 1,
        epsilon = 0.001, ...)


aydindemircioglu/SVMBridge documentation built on May 11, 2019, 4:13 p.m.