Class IndexLoss


public class IndexLoss extends Loss
A wrapper for a Loss that evaluates on only a particular NDArray in the predictions and/or labels NDLists.
  • Constructor Details

    • IndexLoss

      public IndexLoss(Loss loss, int index)
      Constructs an IndexLoss with the same index for both predictions and labels.
      Parameters:
      loss - the base evaluator
      index - the index for both predictions and labels
    • IndexLoss

      public IndexLoss(Loss loss, Integer predictionsIndex, Integer labelsIndex)
      Constructs an IndexLoss.
      Parameters:
      loss - the base evaluator
      predictionsIndex - the predictions index
      labelsIndex - the labels index
  • Method Details

    • evaluate

      public NDArray evaluate(NDList labels, NDList predictions)
      Calculates the evaluation between the labels and the predictions.
      Specified by:
      evaluate in class Evaluator
      Parameters:
      labels - the correct values
      predictions - the predicted values
      Returns:
      the evaluation result