ksvm-class {kernlab}R Documentation

Class "ksvm"

Description

An S4 class containing the output (model) of the ksvm Support Vector Machines function

Objects from the Class

Objects can be created by calls of the form new("ksvm", ...) or by calls to the ksvm function.

Slots

type:
Object of class "character" containing the problem support vector machine problem type ("C-svc", "nu-svc", "C-bsvc", "spoc-svc", "one-svc", "eps-svr", "nu-svr", "eps-bsvr")
param:
Object of class "list" containing the Support Vector Machine parameters (C, nu, epsilon)
kernelf:
Object of class "function" containing the kernel function
kpar:
Object of class "list" containing the kernel function parameters (hyperparameters)
kcall:
Object of class "ANY" containing the ksvm function call
scaling:
Object of class "ANY" containing the scaling information performed on the data
kterms:
Object of class "ANY" containing the terms representation of the symbolic model used (when using a formula)
xmatrix:
Object of class "matrix" the data matrix used during computations (possibly scaled and whithout NA)
ymatrix:
Object of class "ANY" the response matrix/vector
fit:
Object of class "ANY" with the fitted values, predictions using the training set.
lev:
Object of class "vector" with the levels of the response (in the case of classifiaction)
prob.model:
Object of class "list" with the class prob. model
prior:
Object of class "list" with the prior of the training set
nclass:
Object of class "numeric" containing the number of classes (in the case of classification)
alpha:
Object of class "ANY" containing the resulting alpha vector (list or matrix in case of multiclass classification) (support vectors)
coeff:
Object of class "ANY" containing the resulting coefficients
alphaindex:
Object of class "list" containing
b:
Object of class "numeric" containing the resulting offset
SVindex:
Object of class "vector" containing the indexes of the support vectors
nSV:
Object of class "numeric" containing the number of suppport vector machines
error:
Object of class "numeric" containing the training error
cross:
Object of class "numeric" containing the cross-validation error
n.action:
Object of class "ANY" containing the action performed for NA

Methods

SVindex
signature(object = "ksvm"): return the indexes of support vectors
alpha
signature(object = "ksvm"): returns the complete alpha vector (wit zero values)
alphaindex
signature(object = "ksvm"): returns the indexes of non-zero alphas (support vectors)
cross
signature(object = "ksvm"): returns the cross-validation error
error
signature(object = "ksvm"): returns the training error
fit
signature(object = "ksvm"): returns the fitted values (predict on training set)
kernelf
signature(object = "ksvm"): returns the kernel function
kpar
signature(object = "ksvm"): returns the kernel parameters (hyperparameters)
lev
signature(object = "ksvm"): returns the levels in case of classification
prob.model
signature(object="ksvm"): returns class prob. model values
prior
signature(object="ksvm"): returns the prior of the training set
kcall
signature(object="ksvm"): returns the ksvm function call
scaling
signature(object = "ksvm"): returns the scaling values
show
signature(object = "ksvm"): prints the object information
type
signature(object = "ksvm"): returns the problem type
xmatrix
signature(object = "ksvm"): returns the data matrix used
ymatrix
signature(object = "ksvm"): returns the response vector

Author(s)

Alexandros Karatzoglou
alexandros.karatzolgou@ci.tuwien.ac.at

See Also

ksvm, rvm-class, gausspr-class

Examples

## simple example using the promotergene data set
data(promotergene)

## train a support vector machine
gene <- ksvm(Class~.,data=promotergene,kernel="rbfdot",kpar=list(sigma=0.015),C=50,cross=4)
gene

# the kernel  function
kernelf(gene)
# the alpha values
alpha(gene)
# the coefficients
coeff(gene)
# the fitted values
fit(gene)
# the cross validation error
cross(gene)


[Package kernlab version 0.6-2 Index]