fr.lip6.classifier
Class DoublePegasosSVM

java.lang.Object
  extended by fr.lip6.classifier.DoublePegasosSVM
All Implemented Interfaces:
Classifier<double[]>, java.io.Serializable

public class DoublePegasosSVM
extends java.lang.Object
implements Classifier<double[]>, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
DoublePegasosSVM()
           
 
Method Summary
 double getB()
           
 int getK()
           
 double getLambda()
           
 int getT()
           
 double[] getW()
           
 void setB(double b)
          Setting the bias term
 void setK(int k)
           
 void setLambda(double lambda)
           
 void setT(int t)
           
 void setW(double[] w)
          Setting the hyperplane coordinates
 void train(java.util.ArrayList<TrainingSample<double[]>> l)
          Replace the current training and train the classifier
 void train(TrainingSample<double[]> t)
          Add a single example to the current training set and train the classifier
 double valueOf(double[] e)
          Computes the category of the provided example
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoublePegasosSVM

public DoublePegasosSVM()
Method Detail

train

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

Specified by:
train in interface Classifier<double[]>
Parameters:
l - list of training samples

train

public void train(TrainingSample<double[]> 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<double[]>
Parameters:
t - the training sample

valueOf

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

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

getT

public int getT()
Returns:
the t

setT

public void setT(int t)
Parameters:
t - the t to set

getK

public int getK()
Returns:
the k

setK

public void setK(int k)
Parameters:
k - the k to set

getLambda

public double getLambda()
Returns:
the lambda

setLambda

public void setLambda(double lambda)
Parameters:
lambda - the lambda to set

getW

public double[] getW()
Returns:
the hyperplane coordinates

setW

public void setW(double[] w)
Setting the hyperplane coordinates

Parameters:
w - the w to set

getB

public double getB()
Returns:
the bias

setB

public void setB(double b)
Setting the bias term

Parameters:
b - the b to set