edu.cmu.minorthird.classify
Class ManyVsRestLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.OneVsAllLearner
      extended by edu.cmu.minorthird.classify.ManyVsRestLearner
All Implemented Interfaces:
ClassifierLearner, java.lang.Cloneable

public class ManyVsRestLearner
extends OneVsAllLearner

Multi-class version of a binary classifier; Generalizes OneVsAllLearner. OneVsAll allows one class with positive labels for each example, and the rest with negative labels. In ManyVsRest, in each example many classes may be positive.

Author:
Vitor Carvalho.

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.cmu.minorthird.classify.OneVsAllLearner
OneVsAllLearner.IllegalArgumentException
 
Field Summary
 
Fields inherited from class edu.cmu.minorthird.classify.OneVsAllLearner
innerLearner, learner, learnerFactory, learnerName, schema
 
Constructor Summary
ManyVsRestLearner()
           
ManyVsRestLearner(BatchClassifierLearner learner1)
           
ManyVsRestLearner(java.lang.String learnerName)
           
 
Method Summary
 void addExample(Example answeredQuery)
          Accept a labeled example.
 ClassifierLearner copy()
          Make a copy of the learner.
 
Methods inherited from class edu.cmu.minorthird.classify.OneVsAllLearner
completeTraining, getClassifier, getInnerLearner, getSchema, hasNextQuery, nextQuery, reset, setInnerLearner, setInstancePool, setSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManyVsRestLearner

public ManyVsRestLearner()

ManyVsRestLearner

public ManyVsRestLearner(BatchClassifierLearner learner1)

ManyVsRestLearner

public ManyVsRestLearner(java.lang.String learnerName)
Method Detail

copy

public ClassifierLearner copy()
Description copied from interface: ClassifierLearner
Make a copy of the learner. Note: This will reset the learner, erasing previous data!

Specified by:
copy in interface ClassifierLearner
Overrides:
copy in class OneVsAllLearner

addExample

public void addExample(Example answeredQuery)
Description copied from interface: ClassifierLearner
Accept a labeled example. The example might be the answer to the last query, or it may be an example chosen by the teacher.

All learners must provide a non-trivial implementation of addExample.

Specified by:
addExample in interface ClassifierLearner
Overrides:
addExample in class OneVsAllLearner