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

Interface LossMC

  • All Superinterfaces:
    LossC, LossFunc, java.io.Serializable
    All Known Implementing Classes:
    HingeLoss, SoftmaxLoss


    public interface LossMC
    extends LossC
    Specifies a loss function for multi-class problems. A multi-class loss function must support a raw vector of scores for each class, where positive values indicate preference for the class associated with the same index.

    Calling process(jsat.linear.Vec, jsat.linear.Vec) on the raw scores is a mandatory first step, and will transform the raw scores into a usable form for the loss function.

    • Method Detail

      • getLoss

        double getLoss(Vec processed,
                       int y)
        Computes the scalar loss for on the given example
        Parameters:
        processed - the vector of raw predictions.
        y - the true class label in [0, k-1] for k classes
        Returns:
        the loss in [0, Inf)
      • process

        void process(Vec pred,
                     Vec processed)
        Given the vector of raw outputs for each class, transform it into a new vector.
        processed and derivs may be the same object, and will simply have all its values altered if so.
        Parameters:
        pred - the vector of raw predictions
        processed - the location to store the processed predictions.
      • deriv

        void deriv(Vec processed,
                   Vec derivs,
                   int y)
        Computes the derivatives with respect to each output
        processed and derivs may be the same object, and will simply have all its values altered if so.
        Parameters:
        processed - the processed predictions
        derivs - the vector to place the derivative of the loss to.
        y - the true class label in [0, k-1] for k classes
      • getClassification

        CategoricalResults getClassification(Vec processed)
        Given the processed predictions, returns the classification results for said predictions.
        Parameters:
        processed - the processed score/prediction vector
        Returns:
        the classification results

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.