Package org.tribuo.classification
Class LabelFactory
java.lang.Object
org.tribuo.classification.LabelFactory
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>,Serializable,OutputFactory<Label>
A factory for making Label related classes.
Parses the Label by calling toString on the input.
Label factories have no state, and are all equal to each other.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LabelThe singleton unknown label, used for unlablled examples. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconstructInfoForExternalModel(Map<Label, Integer> mapping) booleanGenerates an empty MutableLabelInfo.<V> LabelgenerateOutput(V label) Generates the Label string by calling toString on the input.inthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfigMethods inherited from interface org.tribuo.OutputFactory
generateOutputs
-
Field Details
-
UNKNOWN_LABEL
The singleton unknown label, used for unlablled examples.
-
-
Constructor Details
-
LabelFactory
public LabelFactory()Constructs a label factory.
-
-
Method Details
-
generateOutput
Generates the Label string by calling toString on the input.- Specified by:
generateOutputin interfaceOutputFactory<Label>- Type Parameters:
V- The type of the input.- Parameters:
label- An input value.- Returns:
- A Label object.
-
getUnknownOutput
- Specified by:
getUnknownOutputin interfaceOutputFactory<Label>
-
generateInfo
Generates an empty MutableLabelInfo.- Specified by:
generateInfoin interfaceOutputFactory<Label>- Returns:
- An empty MutableLabelInfo.
-
constructInfoForExternalModel
- Specified by:
constructInfoForExternalModelin interfaceOutputFactory<Label>
-
getEvaluator
- Specified by:
getEvaluatorin interfaceOutputFactory<Label>
-
hashCode
-
equals
-
getProvenance
- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<OutputFactoryProvenance>
-