Class ConfusionMatrixPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ConfusionMatrixPanel
extends JPanel
Visualizes a confusion matrix. Each element is assumed to have a value from 0 to 1.0
See Also:
Serialized Form
  • Constructor Details

    • ConfusionMatrixPanel

      public ConfusionMatrixPanel​(DMatrixRMaj M, List<String> labels, int widthPixels, boolean gray)
      Constructor that specifies the confusion matrix and width/height
      labels - Optional labels for the confusion matrix.
      widthPixels - preferred width and height of the panel in pixels
      gray - Render gray scale or color image
    • ConfusionMatrixPanel

      public ConfusionMatrixPanel​(int widthPixels, boolean hasLabels)
      Constructor in which the prefered width and height is specified in pixels
      widthPixels - preferred width and height
  • Method Details

    • setMatrix

      public void setMatrix​(DMatrixRMaj A)
    • setLabels

      public void setLabels​(List<String> labels)
    • getHighlightCategory

      public int getHighlightCategory()
    • setHighlightCategory

      public void setHighlightCategory​(int highlightCategory)
    • paint

      public void paint​(Graphics g)
      paint in class JComponent
    • whatIsAtPoint

      public ConfusionMatrixPanel.LocationInfo whatIsAtPoint​(int pixelX, int pixelY, ConfusionMatrixPanel.LocationInfo output)
      Use to sample the panel to see what is being displayed at the location clicked. All coordinates are in panel coordinates.
      pixelX - x-axis in panel coordinates
      pixelY - y-axis in panel coordinates
      output - (Optional) storage for output.
      Information on what is at the specified location
    • main

      public static void main​(String[] args)