Learn R Programming

CompositionalML (version 1.0)

alpha-SVM: \(\alpha\)-SVM

Description

\(\alpha\)-SVM.

Usage

alfa.svm(xnew, y, x, a = seq(-1, 1, by = 0.1), cost = seq(0.2, 2, by = 0.2), gamma = NULL)

Value

A list including:

mod

A list with the results of the SVM model for each value of \(\alpha\) that includes the SVM output (an svm class object) as provided by the function "svm" of the package e1071, the configurations used (cost and \(\gamma\) values) and the predicted values of "xnew".

Arguments

xnew

A matrix with the new compositional data whose group is to be predicted. Zeros are allowed, but you must be careful to choose strictly positive vcalues of \(\alpha\).

y

The response variable, it can either be a factor (for classification) or a numeric vector (for regression). Depending on the nature of the response variable, the function will proceed with the necessary task.

x

A matrix with the compositional data.

a

A vector with a grid of values of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If a=0, the isometric log-ratio transformation is applied.

cost

A grid of values for the cost of constraints violation. The cost is the "C"-constant of the regularization term in the Lagrange formulation.

gamma

A grid of values for the \(\gamma\) parameter of the Gaussian kernel. If no values are supplied the default grid is used, ten equidistant values from \(1/D^2\) to \(\sqrt{D}\),

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

For each value of \(\alpha\), the compositional data are transformed and then the SVM is applied for one or more combinations of the cost and \(\gamma\) parameters.

References

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

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

alfasvm.tune

Examples

Run this code
x <- as.matrix(iris[, 1:4])
x <- x/ rowSums(x)
y <- iris[, 5]
mod <- alfa.svm(x, y, x, a = c(0, 0.5, 1), cost = c(0.2, 0.4), gamma = c(0.1, 0.2) )
mod

Run the code above in your browser using DataLab