SciLib.Neuro.SVM
Class OAOSVM

java.lang.Object
  extended by SciLib.Neuro.SVM.SVM
      extended by SciLib.Neuro.SVM.OAOSVM
All Implemented Interfaces:
SMO

public class OAOSVM
extends SVM
implements SMO


Field Summary
 
Fields inherited from class SciLib.Neuro.SVM.SVM
alpha, B, b_low, b_up, binary, C, eps, error_cache, file, GACV1, i_low, i_up, JHB, K, N, patterns, sparse, sv, svIndex, targets, tolerance
 
Constructor Summary
OAOSVM(int m, FileHandler file, Kernel K)
          Constructor
 
Method Summary
 void crossValidation(int kf, double startLog2C, int cs, double startLambda, int ls, double a, double b)
          cross-validation
 BSVM getKClassifier(int k)
          Get a specific classifier
 void LOOValidation(int type, double startLog2C, int cs, double startLambda, int ls, double a, double b)
          LOO-validation
 void setC(double c)
          Set the value of C
 void setKernel(Kernel k)
          Set the spesific kernel
 double testing(FileHandler testFile, double a, double b)
          testing svm with the data scaled between a, b ( a < b )
 void training(java.lang.String alphaFile, double a, double b)
          training svm with the data scaled between a, b ( a < b )
 
Methods inherited from class SciLib.Neuro.SVM.SVM
computeB, f, f, getAlpha, getB, getC, getEpsi, getFile, getKernel, getNoOfSV, getPatterns, getSV, getSVIndex, getTargets, getTolerance, initialize, initiateParameter, isBinary, isInI0I1I2, isInI0I3I4, isInI1I2, isInI3I4, isSparse, LOOValidation, makeTargets, misclassified, readSVs, setB, setEpsi, setFile, setN, setTolerance, testing, testing, testing, training, writeReport, writeResultToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface SciLib.Neuro.SVM.SMO
LOOValidation, misclassified, testing, testing, testing, training
 

Constructor Detail

OAOSVM

public OAOSVM(int m,
              FileHandler file,
              Kernel K)
Constructor

Parameters:
m - the number of classes, int
file - the file that handles training data, FileHandler
K - the kernel of SVM, Kernel
Method Detail

getKClassifier

public BSVM getKClassifier(int k)
Get a specific classifier

Parameters:
k - the index of the classifier, int

setC

public void setC(double c)
Set the value of C

Overrides:
setC in class SVM
Parameters:
c - the value of C, double

setKernel

public void setKernel(Kernel k)
Set the spesific kernel

Overrides:
setKernel in class SVM
Parameters:
k - the kernel, Kernel

training

public void training(java.lang.String alphaFile,
                     double a,
                     double b)
training svm with the data scaled between a, b ( a < b )

Specified by:
training in interface SMO
Overrides:
training in class SVM
Parameters:
alphaFile - fileName for store the support vectors
a - the lower bound of scaled data
b - the upper bound of scaled data

testing

public double testing(FileHandler testFile,
                      double a,
                      double b)
testing svm with the data scaled between a, b ( a < b )

Specified by:
testing in interface SMO
Overrides:
testing in class SVM
Parameters:
alphaFile - fileName for store the support vectors
a - the lower bound of scaled data
b - the upper bound of scaled data

LOOValidation

public void LOOValidation(int type,
                          double startLog2C,
                          int cs,
                          double startLambda,
                          int ls,
                          double a,
                          double b)
LOO-validation

Specified by:
LOOValidation in interface SMO
Overrides:
LOOValidation in class SVM
Parameters:
type - method of LOO validation, constant JHB, GACV1. etc.
startLog2C - log2 of the start value of C, double
cs - the size of the set that contains all C, int
startLambda - log2 of the start value of lambda, double
ls - the size of the set that contains all lambdas, int
a - the lower bound of scaled data
b - the upper bound of scaled data

crossValidation

public void crossValidation(int kf,
                            double startLog2C,
                            int cs,
                            double startLambda,
                            int ls,
                            double a,
                            double b)
cross-validation

Specified by:
crossValidation in interface SMO
Overrides:
crossValidation in class SVM
Parameters:
k - k-fold cross validation k > 1
startLog2C - log2 of the start value of C, double
cs - the size of the set that contains all C, int
startLambda - log2 of the start value of lambda, double
ls - the size of the set that contains all lambdas, int
a - the lower bound of scaled data
b - the upper bound of scaled data