All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.gui.visualize.VisualizePanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----javax.swing.JComponent
|
+----javax.swing.JPanel
|
+----weka.gui.visualize.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.
- Author:
- Mark Hall (mhall@cs.waikato.ac.nz), Malcolm Ware (mfw4@cs.waikato.ac.nz)
-
VisualizePanel()
- Constructor
-
VisualizePanel(VisualizePanelListener)
- This constructor allows a VisualizePanelListener to be set.
-
addActionListener(ActionListener)
- Add a listener for this visualize panel
-
addPlot(PlotData2D)
- Set a new plot to the visualize panel
-
getCIndex()
- Get the index of the attribute selected for coloring
-
getInstances()
- Get the master plot's instances
-
getName()
- Returns the name associated with this plot.
-
getSIndex()
- Get the index of the shape selected for creating splits.
-
getXIndex()
- Get the index of the attribute on the x axis
-
getYIndex()
- Get the index of the attribute on the y axis
-
main(String[])
- Main method for testing this class
-
setColourIndex(int)
- Sets the index used for colouring.
-
setInstances(Instances)
- Tells the panel to use a new set of instances.
-
setLog(Logger)
- Sets the Logger to receive informational messages
-
setMasterPlot(PlotData2D)
- Set the master plot for the visualize panel
-
setName(String)
- Set a name for this plot
-
setShapes(FastVector)
- This will set the shapes for the instances.
-
setSIndex(int)
-
Set the shape for creating splits.
-
setUpComboBoxes(Instances)
-
-
setXIndex(int)
- Set the index of the attribute for the x axis
-
setYIndex(int)
- Set the index of the attribute for the y axis
VisualizePanel
public VisualizePanel(VisualizePanelListener ls)
- This constructor allows a VisualizePanelListener to be set.
VisualizePanel
public VisualizePanel()
- Constructor
setLog
public void setLog(Logger newLog)
- Sets the Logger to receive informational messages
- Parameters:
- newLog - the Logger that will now get info messages
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.
- Parameters:
- index - the index of the attribute to use for colouring
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
- Throws: Exception
- if index is out of range.
getXIndex
public int getXIndex()
- Get the index of the attribute on the x axis
- Returns:
- the index of the attribute on the x axis
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
- Throws: Exception
- if index is out of range.
getYIndex
public int getYIndex()
- Get the index of the attribute on the y axis
- Returns:
- the index of the attribute on the x axis
getCIndex
public int getCIndex()
- Get the index of the attribute selected for coloring
- Returns:
- the index of the attribute on the x axis
getSIndex
public int getSIndex()
- Get the index of the shape selected for creating splits.
- Returns:
- The index of the shape.
setSIndex
public void setSIndex(int index) throws Exception
- Set the shape for creating splits.
- Parameters:
- index - The index of the shape.
- Throws: Exception
- if index is out of range.
addActionListener
public void addActionListener(ActionListener act)
- Add a listener for this visualize panel
- Parameters:
- act - an ActionListener
setName
public void setName(String plotName)
- Set a name for this plot
- Parameters:
- plotName - the name for the plot
- Overrides:
- setName in class Component
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
getInstances
public Instances getInstances()
- Get the master plot's instances
- Returns:
- the master plot's instances
setShapes
public void setShapes(FastVector l)
- This will set the shapes for the instances.
- Parameters:
- l - A list of the shapes, providing that
the objects in the lists are non editable the data will be
kept intact.
setInstances
public void setInstances(Instances inst)
- Tells the panel to use a new set of instances.
- Parameters:
- inst - a set of Instances
setUpComboBoxes
public void setUpComboBoxes(Instances inst)
setMasterPlot
public void setMasterPlot(PlotData2D newPlot) throws Exception
- Set the master plot for the visualize panel
- Parameters:
- newPlot - the new master plot
- Throws: Exception
- if the master plot could not be set
addPlot
public void addPlot(PlotData2D newPlot) throws Exception
- Set a new plot to the visualize panel
- Parameters:
- newPlot - the new plot to add
- Throws: Exception
- if the plot could not be added
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