svmCMA {CMA} | R Documentation

## Support Vector Machine

### Description

Calls the function `svm` from the package `e1071` that provides an interface to the award-winning LIBSVM routines. For `S4` method information, see svmCMA-methods

### Usage

    svmCMA(X, y, f, learnind, probability, models=FALSE,seed=341,...)

### Arguments

`X` | Gene expression data. Can be one of the following: A `matrix`. Rows correspond to observations, columns to variables. A `data.frame`, when `f` is not missing (s. below). An object of class `ExpressionSet`.
`y` | Class labels. Can be one of the following: A `numeric` vector. A `factor`. A `character` if `X` is an `ExpressionSet` that specifies the phenotype variable. `missing`, if `X` is a `data.frame` and a proper formula `f` is provided. WARNING: The class labels will be re-coded to range from `0` to `K-1`, where `K` is the total number of different classes in the learning set.
`f` | A two-sided formula, if `X` is a `data.frame`. The left part correspond to class labels, the right to variables.
`learnind` | An index vector specifying the observations that belong to the learning set. May be `missing`; in that case, the learning set consists of all observations and predictions are made on the learning set.
`probability` | logical indicating whether the model should allow for probability predictions.
`seed` | Fix random number generator for reproducibility.
`models` | a logical value indicating whether the model object shall be returned
`...` | Further arguments to be passed to `svm` from the package `e1071`

### Value

An object of class `cloutput`.

### Note

Contrary to the default settings in `e1071:::svm`, the used kernel is a linear kernel which has turned to be out a better default setting in the small sample, large number of predictors - situation, because additional nonlinearity is mostly not necessary there. It additionally avoids the tuning of a further kernel parameter `gamma`, s. help of the package `e1071` for details.
Nevertheless, hyperparameter tuning concerning the parameter `cost` must usually be performed to obtain reasonale results, s. `tune`.

### Author(s)

Martin Slawski ms@cs.uni-sb.de

Anne-Laure Boulesteix boulesteix@ibe.med.uni-muenchen.de

Christoph Bernau bernau@ibe.med.uni-muenchen.de

### References

Boser, B., Guyon, I., Vapnik, V. (1992)
A training algorithm for optimal margin classifiers.
Proceedings of the fifth annual workshop on Computational learning theory, pages 144-152, ACM Press.

Chang, Chih-Chung and Lin, Chih-Jen : LIBSVM: a library for Support Vector Machines http://www.csie.ntu.edu.tw/~cjlin/libsvm

Schoelkopf, B., Smola, A.J. (2002)
Learning with kernels. MIT Press, Cambridge, MA.

### See Also

`compBoostCMA`, `dldaCMA`, `ElasticNetCMA`, `fdaCMA`, `flexdaCMA`, `gbmCMA`, `knnCMA`, `ldaCMA`, `LassoCMA`, `nnetCMA`, `pknnCMA`, `plrCMA`, `pls_ldaCMA`, `pls_lrCMA`, `pls_rfCMA`, `pnnCMA`, `qdaCMA`, `rfCMA`, `scdaCMA`, `shrinkldaCMA`

### Examples

    ### load Golub AML/ALL data
    data(golub)
    ### extract class labels
    golubY <- golub[,1]
    ### extract gene expression
    golubX <- as.matrix(golub[,-1])
    ### select learningset
    ratio <- 2/3
    set.seed(111)
    learnind <- sample(length(golubY), size=floor(ratio*length(golubY)))
    ### run _untuned_linear SVM
    svmresult <- svmCMA(X=golubX, y=golubY, learnind=learnind,probability=TRUE)
    ### show results
    show(svmresult)
    ftable(svmresult)
    plot(svmresult)

[Package CMA version 1.46.0 Index]