|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.minorthird.classify.OneVsAllLearner
public class OneVsAllLearner
Multi-class version of a binary classifier.
Nested Class Summary | |
---|---|
static class |
OneVsAllLearner.IllegalArgumentException
|
Field Summary | |
---|---|
protected java.util.List<ClassifierLearner> |
innerLearner
|
protected ClassifierLearner |
learner
|
protected ClassifierLearnerFactory |
learnerFactory
|
protected java.lang.String |
learnerName
|
protected ExampleSchema |
schema
|
Constructor Summary | |
---|---|
OneVsAllLearner()
|
|
OneVsAllLearner(ClassifierLearner learner)
|
|
OneVsAllLearner(ClassifierLearnerFactory learnerFactory)
Deprecated. use OneVsAllLearner(BatchClassifierLearner learner) |
|
OneVsAllLearner(java.lang.String learnerName)
|
Method Summary | |
---|---|
void |
addExample(Example answeredQuery)
Accept a labeled example. |
void |
completeTraining()
Accept a signal that no more training data is available. |
ClassifierLearner |
copy()
Make a copy of the learner. |
Classifier |
getClassifier()
Return the learned classifier. |
ClassifierLearner |
getInnerLearner()
|
ExampleSchema |
getSchema()
Returns the ExampleSchema - constraints on what the Examples will be. |
boolean |
hasNextQuery()
Returns true if the learner has more queries to answer. |
Instance |
nextQuery()
Returns an Instance for which the learner would like a label. |
void |
reset()
Forget everything and prepare for a new learning session. |
void |
setInnerLearner(ClassifierLearner learner)
|
void |
setInstancePool(java.util.Iterator<Instance> iterator)
Accept a set of unlabeled instances. |
void |
setSchema(ExampleSchema schema)
Accept an ExampleSchema - constraints on what the Examples will be. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ClassifierLearnerFactory learnerFactory
protected ClassifierLearner learner
protected java.lang.String learnerName
protected java.util.List<ClassifierLearner> innerLearner
protected ExampleSchema schema
Constructor Detail |
---|
public OneVsAllLearner()
public OneVsAllLearner(ClassifierLearnerFactory learnerFactory)
learnerFactory
- a ClassifierLearnerFactory which should produce a BinaryClassifier with each call.public OneVsAllLearner(java.lang.String learnerName)
public OneVsAllLearner(ClassifierLearner learner)
Method Detail |
---|
public void setInnerLearner(ClassifierLearner learner)
public ClassifierLearner getInnerLearner()
public ClassifierLearner copy()
ClassifierLearner
copy
in interface ClassifierLearner
public void setSchema(ExampleSchema schema)
ClassifierLearner
setSchema
in interface ClassifierLearner
public ExampleSchema getSchema()
ClassifierLearner
getSchema
in interface ClassifierLearner
public void reset()
ClassifierLearner
reset
in interface ClassifierLearner
public void setInstancePool(java.util.Iterator<Instance> iterator)
ClassifierLearner
Learners need not make use of the instance pool.
setInstancePool
in interface ClassifierLearner
public boolean hasNextQuery()
ClassifierLearner
Learners may always return 'false', if they are not active.
hasNextQuery
in interface ClassifierLearner
public Instance nextQuery()
ClassifierLearner
This will only be called if hasNextQuery() returns true.
nextQuery
in interface ClassifierLearner
public void addExample(Example answeredQuery)
ClassifierLearner
All learners must provide a non-trivial implementation of addExample.
addExample
in interface ClassifierLearner
public void completeTraining()
ClassifierLearner
completeTraining
in interface ClassifierLearner
public Classifier getClassifier()
ClassifierLearner
All learners must implement this method.
getClassifier
in interface ClassifierLearner
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |