Class Error

java.lang.Object
smile.validation.metric.Error
All Implemented Interfaces:
Serializable, ToDoubleBiFunction<int[],int[]>, ClassificationMetric

public class Error extends Object implements ClassificationMetric
The number of errors in the population.
See Also:
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    static final Error
    Default instance.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    static int
    of(int[] truth, int[] prediction)
    Calculates the number of errors.
    double
    score(int[] truth, int[] prediction)
    Returns a score to measure the quality of classification.
     

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface smile.validation.metric.ClassificationMetric Link icon

    applyAsDouble
  • Field Details Link icon

    • instance Link icon

      public static final Error instance
      Default instance.
  • Constructor Details Link icon

    • Error Link icon

      public Error()
      Constructor.
  • Method Details Link icon

    • score Link icon

      public double score(int[] truth, int[] prediction)
      Description copied from interface: ClassificationMetric
      Returns a score to measure the quality of classification.
      Specified by:
      score in interface ClassificationMetric
      Parameters:
      truth - the true class labels.
      prediction - the predicted class labels.
      Returns:
      the metric.
    • of Link icon

      public static int of(int[] truth, int[] prediction)
      Calculates the number of errors.
      Parameters:
      truth - the ground truth.
      prediction - the prediction.
      Returns:
      the metric.
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object