Description Usage Arguments Details Value See Also
A localized version of Support Vector Machines.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ossvm(x, ...)
## S3 method for class 'formula'
ossvm(formula, data = NULL, ...,
subset, na.action = na.omit, scale = TRUE)
## Default S3 method:
ossvm(x, y = NULL, scale = TRUE,
type = NULL, kernel = "radial", degree = 3,
gamma = if (is.vector(x)) 1 else 1/ncol(x), coef0 = 0,
cost = 1, nu = 0.5,
wf = c("biweight", "cauchy", "cosine", "epanechnikov", "exponential", "gaussian", "optcosine", "rectangular", "triangular"),
bw, k, nn.only = TRUE, class.weights = NULL,
cachesize = 40, tolerance = 0.001, epsilon = 0.1,
shrinking = TRUE, seed = 1L, ..., subset = NULL,
na.action = na.omit)
|
formula |
A symbolic description of the model to be fit. |
data |
An optional data frame containing the
variables in the model. By default the variables are
taken from the environment which |
x |
(Required if no |
y |
(Only if no |
scale |
A logical vector indicating the variables to
be scaled. If |
type |
|
kernel |
The kernel used in training and predicting. You might consider changing some of the following parameters, depending on the kernel type.
|
degree |
Parameter needed for kernel of type
|
gamma |
Parameter needed for all kernels except
|
coef0 |
Parameter needed for kernels of type
|
cost |
Cost of constraints violation (default: 1)–it is the ‘C’-constant of the regularization term in the Lagrange formulation. |
nu |
Parameter needed for |
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). |
tolerance |
Tolerance of termination criterion (default: 0.001). |
epsilon |
epsilon in the insensitive-loss function (default: 0.1). |
shrinking |
Option whether to use the
shrinking-heuristics (default: |
seed |
Integer seed for libsvm (used for probability prediction models). |
... |
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 |
wf |
A window function which is used to calculate
weights that are introduced into the fitting process.
Either a character string or a function, e.g. |
bw |
(Required only if |
k |
(Required only if |
nn.only |
(Required only if |
This is a localized version of the Support Vector Machine where for each test observation an individual SVM is fitted. Training observations are weighted according to their Euclidean distance from the test observation.
The name of the window function (wf
) can be
specified as a character string. In this case the window
function is generated internally in predict.ossvm
.
Currently supported are "biweight"
,
"cauchy"
, "cosine"
, "epanechnikov"
,
"exponential"
, "gaussian"
,
"optcosine"
, "rectangular"
and
"triangular"
.
Moreover, it is possible to generate the window functions
mentioned above in advance (see
wfs
) and pass them to
ossvm
.
Any other function implementing a window function can
also be used as wf
argument. This allows the user
to try own window functions. See help on
wfs
for details.
For multiclass-classification with k levels, k>2, ‘libsvm’ uses the 'one-against-one'-approach, in which k(k-1)/2 binary classifiers are trained; the appropriate class is found by a voting scheme.
‘libsvm’ internally uses a sparse data representation, which is also high-level supported by the package SparseM.
If the predictor variables include factors, the formula interface must be used to get a correct model matrix.
The probability model for classification fits a logistic distribution using maximum likelihood to the decision values of all binary classifiers, and computes the a-posteriori class probabilities for the multi-class problem using quadratic optimization. The probabilistic regression model assumes (zero-mean) laplace-distributed errors for the predictions, and estimates the scale parameter using maximum likelihood.
An object of class "ossvm"
, a list
containing all information about the SVM model to be
fitted, mainly for internal use:
call |
The (matched) function call. |
x |
The explanatory variables. |
y |
The response vector. |
wf |
The window function used. Always a function, even if the input was a string. |
bw |
(Only if |
k |
(Only if |
nn.only |
(Logical. Only if |
adaptive |
(Logical.)
|
variant |
(Only if |
counts |
The number of observations per class. |
lev |
The class labels (levels of |
N |
The number of observations. |
method |
The
method for scaling the weighted covariance matrices,
either |
type |
|
kernel |
|
cost |
|
degree |
|
gamma |
|
coef0 |
|
cachesize |
|
tolerance |
|
weightlabels |
|
class.weights |
|
shrinking |
|
seed |
|
nu |
|
epsilon |
|
sparse |
|
scaled |
|
x.scale |
|
y.scale |
|
nclasses |
|
labels |
|
levels |
|
na.action |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.