svm: Support Vector Machines

Description Usage Arguments Details Value Constraints Examples

Description

svm is used to train a support vector machine. It can be used to carry out general classification.

Usage

1

Arguments

formula

a symbolic description of the model to be fit.

data

an FLTable wide or deep containing the variables in the model.

kernel

the kernel used in training and predicting, different kernel types are:
linear: u'*v
polynomial: (gamma*u'*v + coef0)^degree
radial : exp(-gamma*|u-v|^2)

cost

cost of constraints violation

degree

parameter needed for kernel of type polynomial.

Details

The wrapper overloads svm and implicitly calls DB-Lytix svm function.

Value

svm returns a FLSVM class object which replicates equivalent R output from svm in e1071 package.

Constraints

All values in FLtable should be numeric, maximum number of observations in the dataset can be 2000 and maximum number of independent columns can be 500. The class variable is binary, with value either -1 or 1 only.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Linear Kernel
FLtbl  <- FLTable(getTestTableName("tblSVMLinSepMultiDim"),
                  "OBSID", whereconditions= "OBSID>307")
FLmodel <- svm(DEP~., data = FLtbl, fetchID = TRUE,
                kernel = "linear")
FLPredict <- predict(FLmodel)
print(FLmodel)

#polynomial Kernel
FLtbl <- FLTable(getTestTableName("tblSVMDense"), 
                 "OBSID", whereconditions = "OBSID>307")
FLmodel <- svm(DEP~., data = FLtbl, fetchID = TRUE, 
               kernel = "polynomial")
FLPredict <- predict(FLmodel)
print(FLmodel)

#Gaussian Kernel
FLtbl <- FLTable(getTestTableName("tblSVMDense"), 
                 "OBSID", whereconditions = "OBSID>307")
FLmodel <- svm(DEP~., data = FLtbl, fetchID = TRUE, 
               kernel = "radial")
FLPredict <- predict(FLmodel)
print(FLmodel)

Fuzzy-Logix/AdapteR documentation built on May 6, 2019, 5:07 p.m.