Usage
## S3 method for class 'formula':
ksvm(x, data = NULL, ..., subset, na.action = na.omit, scaled = TRUE)## S3 method for class 'matrix':
\S4method{ksvm(x, y = NULL, scaled = TRUE, type = NULL, kernel ="rbfdot", kpar = list(sigma = 0.1)par = list(sigma = 0.1),
C = 1, nu = 0.2, epsilon = 0.1, prob.model = FALSE, class.weights = NULL, cachesize = 40, tol = 0.001,
shrinking = TRUE, cross = 0, fit = TRUE, ..., subset, na.action = na.omit)
Arguments
x
a symbolic description of the model to be fit. Note, that an
intercept is always included, whether given in the formula or
not. When not using a formula x is a matrix or vector
containg the variables in the model
data
an optional data frame containing the variables in the model.
By default the variables are taken from the environment which
`ksvm' is called from.
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).
scaled
A logical vector indicating the variables to be
scaled. If 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 (both x
type
ksvm can be used for classification
, for regression, or for novelty detection.
Depending on whether y is
a factor or not, the default setting for type is C-classification or eps-regres
kernel
the kernel function used in training and predicting.
This parameter can be set to any function, of class kernel, which computes a dot product between two
vector arguments. kernlab provides the most popular kernel functions
which can be used by
kpar
the list of hyper-parameters (kernel parameters).
This is a list which contains the parameters to be used with the
kernel function. For valid parameters for existing kernels are :
sigmainverse kernel width for the Radial B
C
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,
one-classification, and nu-regression. The nu
parameter sets the upper bound on the training error and the lower
bound on the fraction of data points t
epsilon
epsilon in the insensitive-loss function used for
eps-regression and nu-regression (default: 0.1)
prob.model
if set to TRUE a model for calculating class
probabilities is fitted on output data created by performing a
3-fold cross-validation on the training data. For details see
references. (default: FALSE)
class.weights
a named vector of weights for the different
classes, used for asymmetric 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)
tol
tolerance of termination criterion (default: 0.001)
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
Squared Error for regression
fit
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
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 NAs 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<