|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umass.cs.mallet.base.classify.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
Field Summary | |
protected Pipe |
instancePipe
|
Constructor Summary | |
protected |
Classifier()
For serialization only. |
|
Classifier(Pipe instancePipe)
|
Method Summary | |
abstract Classification |
classify(Instance instance)
|
Classification[] |
classify(Instance[] instances)
|
java.util.ArrayList |
classify(InstanceList instances)
|
Classification |
classify(java.lang.Object obj)
|
double |
getAccuracy(java.util.ArrayList classifications)
|
double |
getAccuracy(InstanceList ilist)
|
Alphabet |
getAlphabet()
|
double |
getF1(java.util.ArrayList classification,
int index)
Calculate the F1-measure for a particular target index from an array list of classifications |
double |
getF1(java.util.ArrayList classification,
java.lang.Object entry)
Calculate the F1-measure for a particular target entry from an array list of classifications |
double |
getF1(InstanceList ilist,
int index)
Calculate the F1-measure of the classifier on an instance list for a particular target index |
double |
getF1(InstanceList ilist,
java.lang.Object entry)
Calculate the F1-measure of the classifier on an instance list for a particular target entry |
Pipe |
getInstancePipe()
|
LabelAlphabet |
getLabelAlphabet()
|
double |
getPrecision(java.util.ArrayList classification,
int index)
Calculate the precision for a particular target index from an array list of classifications |
double |
getPrecision(java.util.ArrayList classification,
java.lang.Object entry)
Calculate the precision for a particular target entry from an array list of classifications |
double |
getPrecision(InstanceList ilist,
int index)
Calculate the precision of the classifier on an instances list for a particular target index |
double |
getPrecision(InstanceList ilist,
java.lang.Object entry)
Calculate the precision of the classifier on an instance list for a particular target entry |
double |
getRecall(java.util.ArrayList classification,
int index)
Calculate the recall for a particular target index from an array list of classifications |
double |
getRecall(java.util.ArrayList classification,
java.lang.Object entry)
Calculate the recall for a particular target entry from an array list of classifications |
double |
getRecall(InstanceList ilist,
int index)
Calculate the recall of the classifier on an instance list for a particular target index |
double |
getRecall(InstanceList ilist,
java.lang.Object entry)
Calculate the recall of the classifier on an instance list for a particular target entry |
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()
public LabelAlphabet getLabelAlphabet()
public java.util.ArrayList classify(InstanceList instances)
public Classification[] classify(Instance[] instances)
public abstract Classification classify(Instance instance)
public Classification classify(java.lang.Object obj)
public double getAccuracy(InstanceList ilist)
public double getAccuracy(java.util.ArrayList classifications)
public double getPrecision(InstanceList ilist, java.lang.Object entry)
public double getPrecision(java.util.ArrayList classification, java.lang.Object entry)
public double getPrecision(InstanceList ilist, int index)
public double getPrecision(java.util.ArrayList classification, int index)
public double getRecall(InstanceList ilist, java.lang.Object entry)
public double getRecall(InstanceList ilist, int index)
public double getRecall(java.util.ArrayList classification, java.lang.Object entry)
public double getRecall(java.util.ArrayList classification, int index)
public double getF1(InstanceList ilist, java.lang.Object entry)
public double getF1(InstanceList ilist, int index)
public double getF1(java.util.ArrayList classification, java.lang.Object entry)
public double getF1(java.util.ArrayList classification, int index)
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 |