edu.cmu.minorthird.classify.algorithms.linear
Class PassiveAggressiveLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.OnlineClassifierLearner
      extended by edu.cmu.minorthird.classify.OnlineBinaryClassifierLearner
          extended by edu.cmu.minorthird.classify.algorithms.linear.PassiveAggressiveLearner
All Implemented Interfaces:
BinaryClassifierLearner, ClassifierLearner, java.io.Serializable, java.lang.Cloneable

public class PassiveAggressiveLearner
extends OnlineBinaryClassifierLearner
implements java.io.Serializable

Created on Sep 26, 2005

Author:
Vitor R. Carvalho Passive Aggressive algorithm as described in "Online Passive Agressive Algorithms" Cramer, Dekel, Shalev-Shwartz, Singer, NIPS 2003. Classification mode. Additionally, it implements optionally a voting scheme. (voted parameter)
See Also:
Serialized Form

Constructor Summary
PassiveAggressiveLearner()
           
PassiveAggressiveLearner(double eta, double gamma, boolean voted)
           
 
Method Summary
 void addExample(Example example)
          Subclasses should use this method to perform whatever incremental update is needed after in response to a new example.
 Classifier getClassifier()
          Subclasses should use this method to return the current classifier.
 double getNormSquared(Instance ins)
           
static void main(java.lang.String[] args)
           
 void reset()
          'forget' everything about the last learning task, and start a new task.
 java.lang.String toString()
           
 
Methods inherited from class edu.cmu.minorthird.classify.OnlineBinaryClassifierLearner
getBinaryClassifier, getSchema, setSchema
 
Methods inherited from class edu.cmu.minorthird.classify.OnlineClassifierLearner
completeTraining, copy, hasNextQuery, nextQuery, setInstancePool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.cmu.minorthird.classify.ClassifierLearner
completeTraining, copy, hasNextQuery, nextQuery, setInstancePool
 

Constructor Detail

PassiveAggressiveLearner

public PassiveAggressiveLearner()

PassiveAggressiveLearner

public PassiveAggressiveLearner(double eta,
                                double gamma,
                                boolean voted)
Method Detail

reset

public void reset()
Description copied from class: OnlineClassifierLearner
'forget' everything about the last learning task, and start a new task. Subclasses need to implement this method

Specified by:
reset in interface ClassifierLearner
Specified by:
reset in class OnlineClassifierLearner

addExample

public void addExample(Example example)
Description copied from class: OnlineClassifierLearner
Subclasses should use this method to perform whatever incremental update is needed after in response to a new example.

Specified by:
addExample in interface ClassifierLearner
Specified by:
addExample in class OnlineClassifierLearner

getNormSquared

public double getNormSquared(Instance ins)

getClassifier

public Classifier getClassifier()
Description copied from class: OnlineClassifierLearner
Subclasses should use this method to return the current classifier.

Specified by:
getClassifier in interface ClassifierLearner
Specified by:
getClassifier in class OnlineClassifierLearner

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)