Class AbsoluteLoss

java.lang.Object
org.tribuo.regression.sgd.objectives.AbsoluteLoss
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, SGDObjective<DenseVector>, RegressionObjective

public class AbsoluteLoss extends Object implements RegressionObjective
Absolute loss (i.e., l1).
  • Constructor Details

    • AbsoluteLoss

      public AbsoluteLoss()
      Constructs an absolute loss.
  • Method Details

    • loss

      @Deprecated public com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> loss(DenseVector truth, SGDVector prediction)
      Deprecated.
      Description copied from interface: RegressionObjective
      Scores a prediction, returning the loss.
      Specified by:
      loss in interface RegressionObjective
      Parameters:
      truth - The true regression value.
      prediction - The predicted regression value.
      Returns:
      A pair with the loss and gradient.
    • lossAndGradient

      public com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> lossAndGradient(DenseVector truth, SGDVector prediction)
      Description copied from interface: SGDObjective
      Scores a prediction, returning the loss and a vector of per output dimension gradients.
      Specified by:
      lossAndGradient in interface RegressionObjective
      Specified by:
      lossAndGradient in interface SGDObjective<DenseVector>
      Parameters:
      truth - The true output.
      prediction - The prediction for each dimension.
      Returns:
      The score and per dimension gradient.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProvenance

      public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
      Specified by:
      getProvenance in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>