|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.classify.Classifier
public abstract class Classifier
Abstract parent of all Classifiers.
All classification techniques in MALLET are implemented as two classes: a trainer and a classifier. The trainer injests the training data and creates a classifier that holds the parameters set during training. The classifier applies those parameters to an Instance to produce a classification of the Instance.
A concrete classifier is required only to be able to classify an instance.
Methods for classifying an InstanceList are here. There are
also methods for calculating precison, recall, and f1 from either
InstanceLists (which are classified first) or an ArrayList of
classifications. Similar functionality is also in
Trial
A classifier holds a reference to the pipe that was used to create the Instances being classified. Most classifiers use this to make sure the Alphabets of the instances being classified are the same Alphabet objects used during training.
Alphabets are allowed to between training and classification.
ClassifierTrainer
,
Instance
,
InstanceList
,
Classification
,
Trial
,
Serialized FormField Summary | |
---|---|
protected Pipe |
instancePipe
|
Constructor Summary | |
---|---|
protected |
Classifier()
For serialization only. |
|
Classifier(Pipe instancePipe)
|
Method Summary | |
---|---|
boolean |
alphabetsMatch(AlphabetCarrying object)
|
abstract Classification |
classify(Instance instance)
|
Classification[] |
classify(Instance[] instances)
|
java.util.ArrayList<Classification> |
classify(InstanceList instances)
|
Classification |
classify(java.lang.Object obj)
Pipe the object through this classifier's pipe, then classify the resulting instance. |
double |
getAccuracy(InstanceList ilist)
|
Alphabet |
getAlphabet()
|
Alphabet[] |
getAlphabets()
|
double |
getAverageRank(InstanceList ilist)
|
double |
getF1(InstanceList ilist,
int index)
|
double |
getF1(InstanceList ilist,
Labeling labeling)
|
double |
getF1(InstanceList ilist,
java.lang.Object labelEntry)
|
FeatureSelection |
getFeatureSelection()
|
Pipe |
getInstancePipe()
|
LabelAlphabet |
getLabelAlphabet()
|
FeatureSelection[] |
getPerClassFeatureSelection()
|
double |
getPrecision(InstanceList ilist,
int index)
|
double |
getPrecision(InstanceList ilist,
Labeling labeling)
|
double |
getPrecision(InstanceList ilist,
java.lang.Object labelEntry)
|
double |
getRecall(InstanceList ilist,
int index)
|
double |
getRecall(InstanceList ilist,
Labeling labeling)
|
double |
getRecall(InstanceList ilist,
java.lang.Object labelEntry)
|
void |
print()
Outputs human-readable description of classifier (e.g., list of weights, decision tree) to System.out |
void |
print(java.io.PrintWriter out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Pipe instancePipe
Constructor Detail |
---|
protected Classifier()
public Classifier(Pipe instancePipe)
Method Detail |
---|
public Pipe getInstancePipe()
public Alphabet getAlphabet()
getAlphabet
in interface AlphabetCarrying
public LabelAlphabet getLabelAlphabet()
public Alphabet[] getAlphabets()
getAlphabets
in interface AlphabetCarrying
public boolean alphabetsMatch(AlphabetCarrying object)
public java.util.ArrayList<Classification> classify(InstanceList instances)
public Classification[] classify(Instance[] instances)
public abstract Classification classify(Instance instance)
public Classification classify(java.lang.Object obj)
public FeatureSelection getFeatureSelection()
public FeatureSelection[] getPerClassFeatureSelection()
public double getAccuracy(InstanceList ilist)
public double getPrecision(InstanceList ilist, int index)
public double getPrecision(InstanceList ilist, Labeling labeling)
public double getPrecision(InstanceList ilist, java.lang.Object labelEntry)
public double getRecall(InstanceList ilist, int index)
public double getRecall(InstanceList ilist, Labeling labeling)
public double getRecall(InstanceList ilist, java.lang.Object labelEntry)
public double getF1(InstanceList ilist, int index)
public double getF1(InstanceList ilist, Labeling labeling)
public double getF1(InstanceList ilist, java.lang.Object labelEntry)
public double getAverageRank(InstanceList ilist)
public void print()
public void print(java.io.PrintWriter out)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |