|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--weka.gui.visualize.VisualizePanel
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.
Nested Class Summary | |
protected class |
VisualizePanel.PlotPanel
Inner class to handle plotting |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected ActionListener |
listener
An optional listener that we will inform when ComboBox selections change |
protected FileFilter |
m_ArffFilter
Filter to ensure only arff files are selected |
protected AttributePanel |
m_attrib
The panel that displays the attributes , using color to represent another attribute. |
protected JButton |
m_cancel
Button for the user to remove all splits. |
protected ClassPanel |
m_classPanel
The panel that displays the legend for the colouring attribute |
protected JPanel |
m_classSurround
Panel that surrounds the class panel with a titled border |
protected FastVector |
m_colorList
The list of the colors used |
protected JComboBox |
m_ColourCombo
Lets the user select the attribute to use for colouring |
protected Color[] |
m_DefaultColors
default colours for colouring discrete class |
protected JFileChooser |
m_FileChooser
file chooser for saving instances |
protected JSlider |
m_Jitter
The jitter slider |
protected JLabel |
m_JitterLab
Label for the jitter slider |
protected LegendPanel |
m_legendPanel
The panel that displays legend info if there is more than one plot |
protected Logger |
m_Log
the logger |
protected VisualizePanel.PlotPanel |
m_plot
The panel that displays the plot |
protected String |
m_plotName
The name of the plot (not currently displayed, but can be used in the containing Frame or Panel) |
protected JPanel |
m_plotSurround
Panel that surrounds the plot panel with a titled border |
protected String |
m_preferredColourDimension
|
protected String |
m_preferredXDimension
These hold the names of preferred columns to visualize on---if the user has defined them in the Visualize.props file |
protected String |
m_preferredYDimension
|
protected JButton |
m_saveBut
Button for the user to save the visualized set of instances |
protected JComboBox |
m_ShapeCombo
Lets the user select the shape they want to create for instance selection. |
protected boolean |
m_showAttBars
Show the attribute bar panel |
protected VisualizePanelListener |
m_splitListener
An optional listener that we will inform when the user creates a split to seperate instances. |
protected JButton |
m_submit
Button for the user to enter the splits. |
protected JComboBox |
m_XCombo
Lets the user select the attribute for the x axis |
protected JComboBox |
m_YCombo
Lets the user select the attribute for the y axis |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
VisualizePanel()
Constructor |
|
VisualizePanel(VisualizePanelListener ls)
This constructor allows a VisualizePanelListener to be set. |
Method Summary | |
void |
addActionListener(ActionListener act)
Add a listener for this visualize panel |
void |
addPlot(PlotData2D newPlot)
Set a new plot to the visualize panel |
int |
getCIndex()
Get the index of the attribute selected for coloring |
Instances |
getInstances()
Get the master plot's instances |
String |
getName()
Returns the name associated with this plot. "" is returned if no name is set. |
int |
getSIndex()
Get the index of the shape selected for creating splits. |
int |
getXIndex()
Get the index of the attribute on the x axis |
int |
getYIndex()
Get the index of the attribute on the y axis |
static void |
main(String[] args)
Main method for testing this class |
protected void |
newColorAttribute(int a,
Instances i)
Sets the Colors in use for a different attrib if it is not a nominal attrib and or does not have more possible values then this will do nothing. |
void |
setColourIndex(int index)
Sets the index used for colouring. |
void |
setInstances(Instances inst)
Tells the panel to use a new set of instances. |
void |
setLog(Logger newLog)
Sets the Logger to receive informational messages |
void |
setMasterPlot(PlotData2D newPlot)
Set the master plot for the visualize panel |
void |
setName(String plotName)
Set a name for this plot |
void |
setShapes(FastVector l)
This will set the shapes for the instances. |
void |
setSIndex(int index)
Set the shape for creating splits. |
void |
setUpComboBoxes(Instances inst)
|
void |
setXIndex(int index)
Set the index of the attribute for the x axis |
void |
setYIndex(int index)
Set the index of the attribute for the y axis |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Color[] m_DefaultColors
protected JComboBox m_XCombo
protected JComboBox m_YCombo
protected JComboBox m_ColourCombo
protected JComboBox m_ShapeCombo
protected JButton m_submit
protected JButton m_cancel
protected JButton m_saveBut
protected JFileChooser m_FileChooser
protected FileFilter m_ArffFilter
protected JLabel m_JitterLab
protected JSlider m_Jitter
protected VisualizePanel.PlotPanel m_plot
protected AttributePanel m_attrib
protected LegendPanel m_legendPanel
protected JPanel m_plotSurround
protected JPanel m_classSurround
protected ActionListener listener
protected VisualizePanelListener m_splitListener
protected String m_plotName
protected ClassPanel m_classPanel
protected FastVector m_colorList
protected String m_preferredXDimension
protected String m_preferredYDimension
protected String m_preferredColourDimension
protected boolean m_showAttBars
protected Logger m_Log
Constructor Detail |
public VisualizePanel(VisualizePanelListener ls)
public VisualizePanel()
Method Detail |
public void setLog(Logger newLog)
newLog
- the Logger that will now get info messagespublic void setColourIndex(int index)
index
- the index of the attribute to use for colouringpublic void setXIndex(int index) throws Exception
index
- the index for the x axis
Exception
- if index is out of range.public int getXIndex()
public void setYIndex(int index) throws Exception
index
- the index for the y axis
Exception
- if index is out of range.public int getYIndex()
public int getCIndex()
public int getSIndex()
public void setSIndex(int index) throws Exception
index
- The index of the shape.
Exception
- if index is out of range.public void addActionListener(ActionListener act)
act
- an ActionListenerpublic void setName(String plotName)
setName
in class Component
plotName
- the name for the plotpublic String getName()
getName
in class Component
public Instances getInstances()
protected void newColorAttribute(int a, Instances i)
a
- The index of the attribute to color.i
- The instances object that contains the attribute.public void setShapes(FastVector l)
l
- A list of the shapes, providing that
the objects in the lists are non editable the data will be
kept intact.public void setInstances(Instances inst)
inst
- a set of Instancespublic void setUpComboBoxes(Instances inst)
public void setMasterPlot(PlotData2D newPlot) throws Exception
newPlot
- the new master plot
Exception
- if the master plot could not be setpublic void addPlot(PlotData2D newPlot) throws Exception
newPlot
- the new plot to add
Exception
- if the plot could not be addedpublic static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |