fr.lip6.classifier
Class SMOSVM<T>

java.lang.Object
  extended by fr.lip6.classifier.SMOSVM<T>
Type Parameters:
T - Type de donnée de l'espace d'entrée.
All Implemented Interfaces:
Classifier<T>, java.io.Serializable, java.lang.Cloneable

public class SMOSVM<T>
extends java.lang.Object
implements Classifier<T>, java.io.Serializable, java.lang.Cloneable

Classifieur SVM utilisant l'algorithme SMO de J. Platt.
N'importe quel type peut être traité, pourvu qu'un noyau Kernel Soit fournit.

Author:
dpicard
See Also:
Serialized Form

Constructor Summary
SMOSVM(Kernel<T> k)
          Constructeur passant le noyau servant à calculer la similarité entre les éléments de l'espace d'entrée.
 
Method Summary
 java.lang.Object clone()
           
 double[] getAlphas()
          returns support vectors weights
 double getB()
          returns bias
 java.util.ArrayList<TrainingSample<T>> getTrainingSet()
          the ArrayList of TrainingSample used for training
 void retrain()
          réentraînement sur la base des alphas précédents.
 void setAlphas(double[] a)
           
 void setKernel(Kernel<T> k)
           
 void setTrain(java.util.ArrayList<TrainingSample<T>> t)
           
 void train(java.util.ArrayList<TrainingSample<T>> t)
          Replace the current training and train the classifier
 void train(TrainingSample<T> t)
          Add a single example to the current training set and train the classifier
 double valueOf(T e)
          Computes the category of the provided example
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMOSVM

public SMOSVM(Kernel<T> k)
Constructeur passant le noyau servant à calculer la similarité entre les éléments de l'espace d'entrée.

Parameters:
k - le noyau templatisé en
Method Detail

train

public void train(TrainingSample<T> t)
Description copied from interface: Classifier
Add a single example to the current training set and train the classifier

Specified by:
train in interface Classifier<T>
Parameters:
t - the training sample

train

public void train(java.util.ArrayList<TrainingSample<T>> t)
Description copied from interface: Classifier
Replace the current training and train the classifier

Specified by:
train in interface Classifier<T>
Parameters:
t - list of training samples

retrain

public void retrain()
réentraînement sur la base des alphas précédents.


valueOf

public double valueOf(T e)
Description copied from interface: Classifier
Computes the category of the provided example

Specified by:
valueOf in interface Classifier<T>
Parameters:
e - example
Returns:
>0. if e belongs to the category, <0. if not.

getAlphas

public double[] getAlphas()
returns support vectors weights


getB

public double getB()
returns bias

Returns:
the bias of the trained svm

getTrainingSet

public java.util.ArrayList<TrainingSample<T>> getTrainingSet()
the ArrayList of TrainingSample used for training

Returns:
the ArrayList of trainign samples

setKernel

public void setKernel(Kernel<T> k)

setAlphas

public void setAlphas(double[] a)

setTrain

public void setTrain(java.util.ArrayList<TrainingSample<T>> t)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException