Usage
## S3 method for class 'formula':
svm(formula, data = list(), subset, na.action=na.fail,
...)
## S3 method for class 'default':
svm(x, y=NULL, subset, na.action=na.fail, type=NULL, kernel="radial", degree=3, gamma=1/dim(x)[2],
coef0=0, cost=1, nu=0.5, class.weights=NULL, cachesize=40, tolerance=0.001, epsilon=0.5,
shrinking=TRUE, cross=0, fitted=TRUE, ...)
Arguments
formula
a symbolic description of the model to be fit. Note, that an
intercept is always included, whether given in the formula or
not.
data
an optional data frame containing the variables in the model.
By default the variables are taken from the environment which
`svm' is called from.
x
a data matrix or a vector.
y
a response vector with one label for each row/component of x
. Can be either
a factor (for classification tasks) or a numeric vector (for regression).
type
svm
can be used as a classification
machine, as a regresson machine or a density estimator. Depending of whether y
is
a factor or not, the default setting for type
is C-classification
or ep
kernel
the kernel used in training and predicting. You
might consider changing some of the following parameters, depending
on the kernel type.
[object Object],[object Object],[object Object],[object Object]
degree
parameter needed for kernel of type polynomial
(default: 3)
gamma
parameter needed for all kernels except linear
(default: 1/(data dimension))
coef0
parameter needed for kernels of type polynomial
and sigmoid
(default: 0)
cost
cost of constraints violation (default: 1)---it is the
`C'-constant of the regularization term in the Lagrange formulation.
nu
parameter needed for nu-classification
and one-classification
class.weights
a named vector of weights for the different
classes, used for asymetric class sizes. Not all factor levels have
to be supplied (default weight: 1). All components have to be named.
cachesize
cache memory in MB (default 40)
tolerance
tolerance of termination criterion (default: 0.001)
epsilon
epsilon in the insensitive-loss function (default: 0.5)
shrinking
option whether to use the shrinking-heuristics
(default: TRUE
)
cross
if a integer value k>0 is specified, a k-fold cross
validation on the training data is performed to assess the quality
of the model: the accuracy rate for classification and the Mean
Sqared Error for regression
fitted
indicates whether the fitted values should be computed
and included in the model or not (default: TRUE
)
...
additional parameters for the low level fitting function
svm.default
subset
An index vector specifying the cases to be used in the
training sample. (NOTE: If given, this argument must be
named.)
na.action
A function to specify the action to be taken if `NA's are
found. The default action is for the procedure to fail. An
alternative is `na.omit', which leads to rejection of cases
with missing values on any required variable.