Documentation of 'jsat.lossfunctions.LossFunc' Java class
LossFunc
jsat.lossfunctions

Interface LossFunc

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      LossFunc clone() 
      double getConjugate(double b, double pred, double y)
      Computes the result of the conjugate function of this loss.
      double getDeriv(double pred, double y)
      Computes the first derivative of the loss function.
      double getDeriv2(double pred, double y)
      Computes the second derivative of the getLoss function.
      double getDeriv2Max()
      Returns an upper bound on the maximum value of the second derivative.
      double getLoss(double pred, double y)
      Computes the loss for some problem.
      double lipschitz()
      If this loss is L-Lipschitz (1/L Lipschitz smooth), this method will return the value of L.
    • Method Detail

      • getLoss

        double getLoss(double pred,
                       double y)
        Computes the loss for some problem.
        Parameters:
        pred - the predicted value in (-Infinity, Infinity)
        y - the true value in (-Infinity, Infinity)
        Returns:
        the loss in [0, Inf)
      • getDeriv

        double getDeriv(double pred,
                        double y)
        Computes the first derivative of the loss function.
        Parameters:
        pred - the predicted score in (-Infinity, Infinity)
        y - the true value in (-Infinity, Infinity)
        Returns:
        the first derivative of the getLoss
      • getDeriv2

        double getDeriv2(double pred,
                         double y)
        Computes the second derivative of the getLoss function.
        Parameters:
        pred - the predicted score in (-Infinity, Infinity)
        y - the true value in (-Infinity, Infinity)
        Returns:
        the second derivative of the getLoss function
      • getConjugate

        double getConjugate(double b,
                            double pred,
                            double y)
        Computes the result of the conjugate function of this loss. This function is generally optional, and should return Double.NaN if not properly implemented. Many optimization algorithms do require a working implementation though.
        Parameters:
        b - the primary input to the function
        pred - the predicted score in (-Infinity, Infinity)
        y - the true class label in {-1, 1}
        Returns:
        the result of the conjugate function of this loss
      • getDeriv2Max

        double getDeriv2Max()
        Returns an upper bound on the maximum value of the second derivative. If the second derivative does not exist, Double.NaN is a valid result. It is also possible for 0 and Double.POSITIVE_INFINITY to be valid results, and must be checked for.
        Returns:
        the max value of getDeriv2(double, double)
      • lipschitz

        double lipschitz()
        If this loss is L-Lipschitz (1/L Lipschitz smooth), this method will return the value of L. If it is not L-Lipschitz, a value of 0 will be returned.
        Returns:
        the L-Lipschitz constant, or 0 if this loss is not L-Lipschitz;

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.