public final class Hinge extends Object implements MultiLabelObjective
The Hinge loss does not generate a probabilistic model, and uses a NoopNormalizer
.
Constructor and Description |
---|
Hinge()
Construct a hinge objective with a margin of 1.0.
|
Hinge(double margin)
Construct a hinge objective with the supplied margin.
|
Modifier and Type | Method and Description |
---|---|
VectorNormalizer |
getNormalizer()
Returns a new
NoopNormalizer . |
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
boolean |
isProbabilistic()
Returns false.
|
com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> |
lossAndGradient(SGDVector truth,
SGDVector prediction)
|
double |
threshold()
The default prediction threshold for creating the output.
|
String |
toString() |
public Hinge(double margin)
margin
- The margin to use.public Hinge()
public com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> lossAndGradient(SGDVector truth, SGDVector prediction)
lossAndGradient
in interface SGDObjective<SGDVector>
truth
- The true label id.prediction
- The prediction for each label id.public VectorNormalizer getNormalizer()
NoopNormalizer
.getNormalizer
in interface MultiLabelObjective
public boolean isProbabilistic()
isProbabilistic
in interface MultiLabelObjective
public double threshold()
MultiLabelObjective
threshold
in interface MultiLabelObjective
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.