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

Class weka.gui.boundaryvisualizer.BoundaryPanel

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

public class BoundaryPanel
extends javax.swing.JPanel
BoundaryPanel. A class to handle the plotting operations associated with generating a 2D picture of a classifier's decision boundaries.

Since:
1.0
Version:
$Revision: 1.17 $
Author:
Mark Hall
See Also:
javax.swing.JPanel

Variable Index

 o DEFAULT_COLORS
 

Constructor Index

 o BoundaryPanel(int, int)
Creates a new BoundaryPanel instance.

Method Index

 o addActionListener(ActionListener)
Register a listener to be notified when plotting completes
 o getColors()
Get the current vector of Color objects used for the classes
 o getGeneratorSamplesBase()
Get the base used for computing the number of samples to obtain from each generator
 o getNumSamplesPerRegion()
Get the number of points to sample from a region (fixed dimensions).
 o getPlotTrainingData()
Returns true if training data is to be superimposed
 o main(String[])
Main method for testing this class
 o removeActionListener(ActionListener)
Remove a listener
 o replot()
Quickly replot the display using cached probability estimates
 o setClassifier(DistributionClassifier)
Set the classifier to use.
 o setColors(FastVector)
Set a vector of Color objects for the classes
 o setDataGenerator(DataGenerator)
Set the data generator to use for generating new instances
 o setGeneratorSamplesBase(double)
Set the base for computing the number of samples to obtain from each generator.
 o setNumSamplesPerRegion(int)
Set the number of points to uniformly sample from a region (fixed dimensions).
 o setPlotTrainingData(boolean)
Set whether to superimpose the training data plot
 o setTrainingData(Instances)
Set the training data to use
 o setXAttribute(int)
Set the x attribute index
 o setYAttribute(int)
Set the y attribute index
 o start()
Start the plotting thread
 o stopPlotting()
Stop the plotting thread

Field Detail

 o DEFAULT_COLORS
public static final java.awt.Color[] DEFAULT_COLORS

Constructor Detail

 o BoundaryPanel
public BoundaryPanel(int panelWidth,
                     int panelHeight)
          Creates a new BoundaryPanel instance.
Parameters:
panelWidth - the width in pixels of the panel
panelHeight - the height in pixels of the panel

Method Detail

 o setNumSamplesPerRegion
public void setNumSamplesPerRegion(int num)
          Set the number of points to uniformly sample from a region (fixed dimensions).
Parameters:
num - an int value
 o getNumSamplesPerRegion
public int getNumSamplesPerRegion()
          Get the number of points to sample from a region (fixed dimensions).
Returns:
an int value
 o setGeneratorSamplesBase
public void setGeneratorSamplesBase(double ksb)
          Set the base for computing the number of samples to obtain from each generator. number of samples = base ^ (# non fixed dimensions)
Parameters:
ksb - a double value
 o getGeneratorSamplesBase
public double getGeneratorSamplesBase()
          Get the base used for computing the number of samples to obtain from each generator
Returns:
a double value
 o stopPlotting
public void stopPlotting()
          Stop the plotting thread
 o start
public void start() throws java.lang.Exception
          Start the plotting thread
Throws:
java.lang.Exception - if an error occurs
 o setTrainingData
public void setTrainingData(Instances trainingData) throws java.lang.Exception
          Set the training data to use
Parameters:
trainingData - the training data
Throws:
java.lang.Exception - if an error occurs
 o addActionListener
public void addActionListener(java.awt.event.ActionListener newListener)
          Register a listener to be notified when plotting completes
Parameters:
newListener - the listener to add
 o removeActionListener
public void removeActionListener(java.awt.event.ActionListener removeListener)
          Remove a listener
Parameters:
removeListener - the listener to remove
 o setClassifier
public void setClassifier(DistributionClassifier classifier)
          Set the classifier to use.
Parameters:
classifier - the classifier to use
 o setDataGenerator
public void setDataGenerator(DataGenerator dataGenerator)
          Set the data generator to use for generating new instances
Parameters:
dataGenerator - the data generator to use
 o setXAttribute
public void setXAttribute(int xatt) throws java.lang.Exception
          Set the x attribute index
Parameters:
xatt - index of the attribute to use on the x axis
Throws:
java.lang.Exception - if an error occurs
 o setYAttribute
public void setYAttribute(int yatt) throws java.lang.Exception
          Set the y attribute index
Parameters:
yatt - index of the attribute to use on the y axis
Throws:
java.lang.Exception - if an error occurs
 o setColors
public void setColors(FastVector colors)
          Set a vector of Color objects for the classes
Parameters:
colors - a FastVector value
 o setPlotTrainingData
public void setPlotTrainingData(boolean pg)
          Set whether to superimpose the training data plot
Parameters:
pg - a boolean value
 o getPlotTrainingData
public boolean getPlotTrainingData()
          Returns true if training data is to be superimposed
Returns:
a boolean value
 o getColors
public FastVector getColors()
          Get the current vector of Color objects used for the classes
Returns:
a FastVector value
 o replot
public void replot()
          Quickly replot the display using cached probability estimates
 o main
public static void main(java.lang.String args[])
          Main method for testing this class
Parameters:
args - a String[] value

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