Class Label
java.lang.Object
org.tribuo.classification.Label
- All Implemented Interfaces:
Serializable,Classifiable<Label>,Output<Label>
An immutable multi-class classification label.
The labels themselves are Strings. A Label also contains an optional score which measures the confidence in that label, though it is not required to be a probability.
Label equality and hashCode is defined solely on the String label, it does not take into account the score.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Deep copy of the output up to it's immutable state.booleanbooleanfullEquals(Label o) Compares other to this output.getLabel()Gets the name of this label.doublegetScore()Get a real valued score for this label.getSerializableForm(boolean includeConfidence) Returns "labelName" or "labelName,score=labelScore".inthashCode()toString()
-
Field Details
-
UNKNOWN
-
label
-
score
The score of the label.
-
-
Constructor Details
-
Label
-
Label
-
-
Method Details
-
getScore
Get a real valued score for this label.If the score is not set then it returns Double.NaN.
- Returns:
- The predicted score for this label.
-
getLabel
-
equals
-
fullEquals
Description copied from interface:OutputCompares other to this output. Uses all score values and the strings.- Specified by:
fullEqualsin interfaceOutput<Label>- Parameters:
o- Another output instance.- Returns:
- True if the other instance has value equality to this instance. False otherwise.
-
hashCode
-
toString
-
copy
-
getSerializableForm
Returns "labelName" or "labelName,score=labelScore".- Specified by:
getSerializableFormin interfaceOutput<Label>- Parameters:
includeConfidence- Include whatever confidence score the label contains, if known.- Returns:
- A String form suitable for serialization.
-