edu.cmu.minorthird.classify.sequential
Class GenericCollinsLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.sequential.GenericCollinsLearner
All Implemented Interfaces:
BatchSequenceClassifierLearner, SequenceClassifierLearner, SequenceConstants

public class GenericCollinsLearner
extends java.lang.Object
implements BatchSequenceClassifierLearner, SequenceConstants

'Generic' version of Collin's voted perceptron learner.

As of May 9, 2004, this is a different algorithm, which is much more like Collin's original method. The 'old' implementation is in GenericCollinsLearnerV1.

Author:
William Cohen

Field Summary
 
Fields inherited from interface edu.cmu.minorthird.classify.sequential.SequenceConstants
HISTORY_FEATURE, NULL_CLASS_NAME
 
Constructor Summary
GenericCollinsLearner()
           
GenericCollinsLearner(int epochs)
           
GenericCollinsLearner(OnlineClassifierLearner innerLearner)
           
GenericCollinsLearner(OnlineClassifierLearner innerLearner, int epochs)
           
GenericCollinsLearner(OnlineClassifierLearner innerLearner, int historySize, int epochs)
           
 
Method Summary
 SequenceClassifier batchTrain(SequenceDataset dataset)
           
 int getHistorySize()
          Return the number of previous predictions used as features in learning.
 OnlineClassifierLearner getInnerLearner()
           
 int getNumberOfEpochs()
           
 void setHistorySize(int newHistorySize)
           
 void setInnerLearner(OnlineClassifierLearner newInnerLearner)
           
 void setNumberOfEpochs(int newNumberOfEpochs)
           
 void setSchema(ExampleSchema schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericCollinsLearner

public GenericCollinsLearner()

GenericCollinsLearner

public GenericCollinsLearner(OnlineClassifierLearner innerLearner)

GenericCollinsLearner

public GenericCollinsLearner(int epochs)

GenericCollinsLearner

public GenericCollinsLearner(OnlineClassifierLearner innerLearner,
                             int epochs)

GenericCollinsLearner

public GenericCollinsLearner(OnlineClassifierLearner innerLearner,
                             int historySize,
                             int epochs)
Method Detail

setSchema

public void setSchema(ExampleSchema schema)
Specified by:
setSchema in interface SequenceClassifierLearner

getInnerLearner

public OnlineClassifierLearner getInnerLearner()

setInnerLearner

public void setInnerLearner(OnlineClassifierLearner newInnerLearner)

getHistorySize

public int getHistorySize()
Description copied from interface: SequenceClassifierLearner
Return the number of previous predictions used as features in learning.

Specified by:
getHistorySize in interface SequenceClassifierLearner

setHistorySize

public void setHistorySize(int newHistorySize)

getNumberOfEpochs

public int getNumberOfEpochs()

setNumberOfEpochs

public void setNumberOfEpochs(int newNumberOfEpochs)

batchTrain

public SequenceClassifier batchTrain(SequenceDataset dataset)
Specified by:
batchTrain in interface BatchSequenceClassifierLearner