Class LogMulticlass
java.lang.Object
org.tribuo.classification.sgd.objectives.LogMulticlass
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,LabelObjective
A multiclass version of the log loss.
Generates a probabilistic model, and uses an ExpNormalizer
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates a newVectorNormalizer
which normalizes the predictions into [0,1].com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
boolean
Returns true.toString()
valueAndGradient
(int truth, SGDVector prediction) Returns aPair
ofDouble
and the supplied prediction vector.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
LogMulticlass
public LogMulticlass()
-
-
Method Details
-
valueAndGradient
public com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> valueAndGradient(int truth, SGDVector prediction) Returns aPair
ofDouble
and the supplied prediction vector.The prediction vector is transformed to produce the per label gradient.
- Specified by:
valueAndGradient
in interfaceLabelObjective
- Parameters:
truth
- The true label idprediction
- The prediction for each label id- Returns:
- A Pair of the score and per label gradient.
-
getNormalizer
Description copied from interface:LabelObjective
Generates a newVectorNormalizer
which normalizes the predictions into [0,1].- Specified by:
getNormalizer
in interfaceLabelObjective
- Returns:
- The vector normalizer for this objective.
-
isProbabilistic
Returns true.- Specified by:
isProbabilistic
in interfaceLabelObjective
- Returns:
- True.
-
toString
-
getProvenance
- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-