All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.gui.explorer.VisualizePanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JPanel
                                   |
                                   +----weka.gui.explorer.VisualizePanel

public class VisualizePanel
extends JPanel
This panel allows the user to visualize a dataset (and if provided) a classifier's/clusterer's predictions in two dimensions. If the user selects a nominal attribute as the colouring attribute then each point is drawn in a colour that corresponds to the discrete value of that attribute for the instance. If the user selects a numeric attribute to colour on, then the points are coloured using a spectrum ranging from blue to red (low values to high). When a classifier's predictions are supplied they are plotted in one of two ways (depending on whether the class is nominal or numeric).
For nominal class: an error made by a classifier is plotted as a square in the colour corresponding to the class it predicted.
For numeric class: predictions are plotted as varying sized x's, where the size of the x is related to the magnitude of the error.

Version:
$Revision: 1.8 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)

Constructor Index

 o VisualizePanel()
Constructor

Method Index

 o addActionListener(ActionListener)
Add a listener for this visualize panel
 o getCIndex()
Get the index of the attribute selected for coloring
 o getInstances()
Get the instances being plotted
 o getName()
Returns the name associated with this plot.
 o getXIndex()
Get the index of the attribute on the x axis
 o getYIndex()
Get the index of the attribute on the y axis
 o main(String[])
Main method for testing this class
 o setColourIndex(int)
Sets the index used for colouring.
 o setInstances(Instances)
Tells the panel to use a new set of instances.
 o setName(String)
Set a name for this plot
 o setPredictions(double[])
Set the classifier's predictions.
 o setPredictionsNumeric(boolean)
Specify whether the classifier's predictions are for a numeric class
 o setXIndex(int)
Set the index of the attribute for the x axis
 o setYIndex(int)
Set the index of the attribute for the y axis

Constructors

 o VisualizePanel
 public VisualizePanel()
Constructor

Methods

 o setColourIndex
 public void setColourIndex(int index)
Sets the index used for colouring. If this method is called then the supplied index is used and the combo box for selecting colouring attribute is disabled. If a negative index is supplied then the colouring combo box is disabled and only the classifier/clusterer's predictions are used for colouring

Parameters:
index - the index of the attribute to use for colouring
 o setXIndex
 public void setXIndex(int index) throws Exception
Set the index of the attribute for the x axis

Parameters:
index - the index for the x axis
 o getXIndex
 public int getXIndex()
Get the index of the attribute on the x axis

Returns:
the index of the attribute on the x axis
 o setYIndex
 public void setYIndex(int index) throws Exception
Set the index of the attribute for the y axis

Parameters:
index - the index for the y axis
 o getYIndex
 public int getYIndex()
Get the index of the attribute on the y axis

Returns:
the index of the attribute on the x axis
 o getCIndex
 public int getCIndex()
Get the index of the attribute selected for coloring

Returns:
the index of the attribute on the x axis
 o setPredictions
 public void setPredictions(double preds[])
Set the classifier's predictions. These must correspond one to one with the instances provided using the setInstances method.

Parameters:
preds - an array of predictions
 o setPredictionsNumeric
 public void setPredictionsNumeric(boolean n)
Specify whether the classifier's predictions are for a numeric class

Parameters:
n - true if the predictions are for a numeric class
 o addActionListener
 public void addActionListener(ActionListener act)
Add a listener for this visualize panel

Parameters:
act - an ActionListener
 o setName
 public void setName(String plotName)
Set a name for this plot

Parameters:
plotName - the name for the plot
Overrides:
setName in class Component
 o getName
 public String getName()
Returns the name associated with this plot. "" is returned if no name is set.

Returns:
the name of the plot
Overrides:
getName in class Component
 o getInstances
 public Instances getInstances()
Get the instances being plotted

Returns:
the instances being plotted
 o setInstances
 public void setInstances(Instances inst)
Tells the panel to use a new set of instances.

Parameters:
inst - a set of Instances
 o main
 public static void main(String args[])
Main method for testing this class


All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home