|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.minorthird.classify.multi.MultiClassLabel
public class MultiClassLabel
A label which is associated with an instance---either by a classifier, or in training data.
MultiClassLabels should be weighted to that the weight for a class name is (approximately) the log-odds having that class name, ie if the probability of class "POS" is p, the getWeight("POS") should return Math.log( p/(1-p) ). The POS and NEG class labels (as defined in ExampleSchema.POS_CLASS_NAME and ExampleSchema.NEG_CLASS_NAME) are special. Binary class labels should be created with the positiveLabel(posWeight) and negativeLabel(negWeight) routines, or else the binaryLabel routine. The numericLabel() returns +1 or -1 for binary classLabels. The posWeight() method returns the score of the positive class. The classLabel.numericLabel() method ignores the underlying score. For testing binary examples, classLabel.isPositive(), classLabel.isNegative(), and classLabel.bestWeight() should be used.
Constructor Summary | |
---|---|
MultiClassLabel()
|
|
MultiClassLabel(ClassLabel[] labels)
|
Method Summary | |
---|---|
java.lang.String[] |
bestClassName()
Returns the highest-ranking label. |
double[] |
bestWeight()
Returns the weight of the highest-ranking label. |
ClassLabel[] |
getLabels()
|
double[] |
getProbability(java.lang.String[] label)
Returns the probability of a label. |
double[] |
getWeight(java.lang.String[] label)
Returns the weight of the label. |
boolean[] |
isBinary()
See if this is one of the distinguished binary labels. |
boolean |
isCorrect(MultiClassLabel otherLabel)
Is this label correct, relative to another label? |
boolean[] |
isMultiCorrect(MultiClassLabel otherLabel)
Is this label correct, relative to another label? |
boolean[] |
isNegative()
See if this is the distinguished negative label. |
boolean[] |
isPositive()
See if this is the distinguished positive label. |
int |
numDimensions()
Return the number of dimensions in the multiLabel |
double[] |
numericLabel()
Return a numeric score of +1, or -1 for a binary example |
double[] |
posProbability()
Returns the probability of the positive class name |
java.util.Set<java.lang.String>[] |
possibleLabels()
Returns the set of labels that appear in the ranking. |
double[] |
posWeight()
Returns the weight of the positive class name |
java.lang.String |
toDetails()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultiClassLabel()
public MultiClassLabel(ClassLabel[] labels)
Method Detail |
---|
public ClassLabel[] getLabels()
public int numDimensions()
public boolean[] isBinary()
public boolean[] isPositive()
public boolean[] isNegative()
public double[] numericLabel()
public java.lang.String[] bestClassName()
public double[] bestWeight()
public double[] posWeight()
public double[] posProbability()
public double[] getWeight(java.lang.String[] label)
public double[] getProbability(java.lang.String[] label)
public java.util.Set<java.lang.String>[] possibleLabels()
public boolean[] isMultiCorrect(MultiClassLabel otherLabel)
public boolean isCorrect(MultiClassLabel otherLabel)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDetails()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |