Class ConfusionMatrix

java.lang.Object
smile.validation.metric.ConfusionMatrix
All Implemented Interfaces:
Serializable

public class ConfusionMatrix extends Object implements Serializable
The confusion matrix of truth and predictions.
See Also:
  • Field Details

    • matrix

      public final int[][] matrix
      Confusion matrix.
  • Constructor Details

    • ConfusionMatrix

      public ConfusionMatrix(int[][] matrix)
      Constructor.
      Parameters:
      matrix - the confusion matrix.
  • Method Details

    • of

      public static ConfusionMatrix of(int[] truth, int[] prediction)
      Creates the confusion matrix.
      Parameters:
      truth - the ground truth.
      prediction - the prediction.
      Returns:
      the confusion matrix.
    • toString

      public String toString()
      Overrides:
      toString in class Object