lssvm
function is an
implementation of the Least Squares SVM. lssvm
includes a
reduced version of Least Squares SVM using a decomposition of the
kernel matrix which is calculated by the csi
function.## S3 method for class 'formula':
lssvm(x, data=NULL, ..., subset, na.action = na.omit, scaled = TRUE)## S3 method for class 'vector':
lssvm(x, ...)
## S3 method for class 'matrix':
lssvm(x, y = NULL, scaled = TRUE, kernel = "rbfdot",
kpar = "automatic", type = NULL, tau = 0.01, tol = 0.0001, rank =
floor(dim(x)[1]/4), delta = 40, cross = 0, fit = TRUE, ..., subset,
na.action = na.omit)
## S3 method for class 'kernelMatrix':
lssvm(x, y, type = NULL, tau = 0.01, tol =
0.0001, rank = floor(dim(x)[1]/3), delta = 40, cross = 0, fit = TRUE, ...)
## S3 method for class 'list':
lssvm(x, y, scaled = TRUE, kernel = "stringdot",
kpar = list(length=4, lambda = 0.5), type = NULL, tau = 0.01, reduced =
TRUE, tol = 0.0001, rank = floor(dim(x)[1]/3), delta = 40, cross = 0,
fit = TRUE, ..., subset)
kernelMatrix
or a list of character vectors.x
. Can be either
a factor (for classification tasks) or a numeric vector (for
classification or regression - currently nor suported -).scaled
is of length 1, the value is recycled as
many times as needed and all non-binary variables are scaled.
Per default, data are scaled internally to zero mean and unity
is a factor or not, the default
setting for type
is "classification" or "regression" respectively,
but can be overwritten by setting an sigma
inverse kernel width for the Radial BFALSE
the full linear problem of the
lssvm is solved, when TRUE
a reduced method using csi
is used.csi
csi
(default 40)csi
function, lower tolerance leads to more preciese approximation but
may increase the training time and the decomposed matrix size (default: 0.0001)NA
s are
found. The default action is na.omit
, which leads to rejection of cases
with missing values on any required variable. An alternative
is na.fail
, whi"lssvm"
containing the fitted model,
Accessor functions can be used to access the slots of the object (see
examples) which include:"lssvm"
csi
function, thus the solution is an approximation
to the exact solution of the lssvm optimization problem. The quality
of the solution depends on the approximation and can be influenced by
the "rank" , "delta", and "tol" parameters.lir <- lssvm(Species~.,data=iris)
lir
lirr <- lssvm(Species~.,data= iris, reduced = FALSE)
lirr
## Using the kernelMatrix interface
iris <- unique(iris)
rbf <- rbfdot(0.5)
k <- kernelMatrix(rbf, as.matrix(iris[,-5]))
klir <- lssvm(k, iris[, 5])
klir
pre <- predict(klir, k)