Package weka.gui.explorer
Class ExperimentPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- weka.gui.explorer.ExperimentPanel
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,weka.gui.explorer.Explorer.CapabilitiesFilterChangeListener
,weka.gui.explorer.Explorer.ExplorerPanel
,weka.gui.explorer.Explorer.LogHandler
public class ExperimentPanel extends JPanel implements weka.gui.explorer.Explorer.CapabilitiesFilterChangeListener, weka.gui.explorer.Explorer.ExplorerPanel, weka.gui.explorer.Explorer.LogHandler
This panel allows the user to select and configure a classifier, set the attribute of the current dataset to be used as the class, and perform an Experiment (like in the Experimenter) with this Classifier/Dataset combination. The results of the experiment runs are stored in a result history so that previous results are accessible.
Based on the ClassifierPanel code (by Len Trigg, Mark Hall and Richard Kirkby).- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.gui.PropertyPanel
m_CEPanel
The panel showing the current classifier selection.protected adams.gui.core.BaseComboBox
m_ClassCombo
Lets the user select the class column.protected weka.gui.GenericObjectEditor
m_ClassifierEditor
Lets the user configure the classifier.protected adams.gui.core.BaseComboBox
m_EvalCombo
The type of evaluation: cross-validation or random split.protected weka.gui.explorer.Explorer
m_Explorer
the parent frame.protected JLabel
m_FoldsPercLabel
The label for either the number of folds or the percentage for the random split.protected adams.gui.core.BaseTextField
m_FoldsPercText
Either the number of folds or the percentage for the random split.protected weka.gui.ResultHistoryPanel
m_History
A panel controlling results viewing.protected weka.core.Instances
m_Instances
The main set of instances we're playing with.protected weka.gui.Logger
m_Log
The destination for log/status messages.protected adams.gui.core.BaseTextArea
m_OutText
The output area for classification results.protected JSpinner
m_RunsSpinner
The spinner for the number of runs.protected Thread
m_RunThread
A thread that classification runs in.protected weka.gui.SaveBuffer
m_SaveOut
The buffer saving object for saving output.protected adams.gui.core.BaseButton
m_StartBut
Click to start running the experiment.protected adams.gui.core.BaseButton
m_StopBut
Click to stop a running experiment.protected weka.core.converters.Loader
m_TestLoader
The loader used to load the user-supplied test set (if any).-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors Constructor Description ExperimentPanel()
Creates the Experiment panel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
capabilitiesFilterChanged(weka.gui.explorer.Explorer.CapabilitiesFilterChangeEvent e)
method gets called in case of a change event.weka.gui.explorer.Explorer
getExplorer()
returns the parent Explorer frame.String
getTabTitle()
Returns the title for the tab in the Explorer.String
getTabTitleToolTip()
Returns the tooltip for the tab in the Explorer.static void
main(String[] args)
Tests out the Experiment panel from the command line.protected void
saveBuffer(String name)
Save the currently selected experiment output to a file.void
setExplorer(weka.gui.explorer.Explorer parent)
Sets the Explorer to use as parent frame (used for sending notifications about changes in the data).void
setInstances(weka.core.Instances inst)
Tells the panel to use a new set of instances.void
setLog(weka.gui.Logger newLog)
Sets the Logger to receive informational messages.protected void
showPopup(String name, int x, int y)
Handles constructing a popup menu with visualization options.protected void
startExperiment()
Starts running the currently configured classifier with the current settings in an experiment.protected void
stopExperiment()
Stops the currently running experiment (if any).protected void
updateCapabilitiesFilter(weka.core.Capabilities filter)
updates the capabilities filter of the GOE.-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_Explorer
protected weka.gui.explorer.Explorer m_Explorer
the parent frame.
-
m_ClassifierEditor
protected weka.gui.GenericObjectEditor m_ClassifierEditor
Lets the user configure the classifier.
-
m_CEPanel
protected weka.gui.PropertyPanel m_CEPanel
The panel showing the current classifier selection.
-
m_OutText
protected adams.gui.core.BaseTextArea m_OutText
The output area for classification results.
-
m_Log
protected weka.gui.Logger m_Log
The destination for log/status messages.
-
m_SaveOut
protected weka.gui.SaveBuffer m_SaveOut
The buffer saving object for saving output.
-
m_History
protected weka.gui.ResultHistoryPanel m_History
A panel controlling results viewing.
-
m_RunsSpinner
protected JSpinner m_RunsSpinner
The spinner for the number of runs.
-
m_EvalCombo
protected adams.gui.core.BaseComboBox m_EvalCombo
The type of evaluation: cross-validation or random split.
-
m_FoldsPercLabel
protected JLabel m_FoldsPercLabel
The label for either the number of folds or the percentage for the random split.
-
m_FoldsPercText
protected adams.gui.core.BaseTextField m_FoldsPercText
Either the number of folds or the percentage for the random split.
-
m_ClassCombo
protected adams.gui.core.BaseComboBox m_ClassCombo
Lets the user select the class column.
-
m_StartBut
protected adams.gui.core.BaseButton m_StartBut
Click to start running the experiment.
-
m_StopBut
protected adams.gui.core.BaseButton m_StopBut
Click to stop a running experiment.
-
m_Instances
protected weka.core.Instances m_Instances
The main set of instances we're playing with.
-
m_TestLoader
protected weka.core.converters.Loader m_TestLoader
The loader used to load the user-supplied test set (if any).
-
m_RunThread
protected Thread m_RunThread
A thread that classification runs in.
-
-
Method Detail
-
setLog
public void setLog(weka.gui.Logger newLog)
Sets the Logger to receive informational messages.- Specified by:
setLog
in interfaceweka.gui.explorer.Explorer.LogHandler
- Parameters:
newLog
- the Logger that will now get info messages
-
setInstances
public void setInstances(weka.core.Instances inst)
Tells the panel to use a new set of instances.- Specified by:
setInstances
in interfaceweka.gui.explorer.Explorer.ExplorerPanel
- Parameters:
inst
- a set of Instances
-
showPopup
protected void showPopup(String name, int x, int y)
Handles constructing a popup menu with visualization options.- Parameters:
name
- the name of the result history list entry clicked on by the userx
- the x coordinate for popping up the menuy
- the y coordinate for popping up the menu
-
startExperiment
protected void startExperiment()
Starts running the currently configured classifier with the current settings in an experiment. This is run in a separate thread, and will only start if there is no experiment already running. The experiment output is sent to the results history panel.
-
saveBuffer
protected void saveBuffer(String name)
Save the currently selected experiment output to a file.- Parameters:
name
- the name of the buffer to save
-
stopExperiment
protected void stopExperiment()
Stops the currently running experiment (if any).
-
updateCapabilitiesFilter
protected void updateCapabilitiesFilter(weka.core.Capabilities filter)
updates the capabilities filter of the GOE.- Parameters:
filter
- the new filter to use
-
capabilitiesFilterChanged
public void capabilitiesFilterChanged(weka.gui.explorer.Explorer.CapabilitiesFilterChangeEvent e)
method gets called in case of a change event.- Specified by:
capabilitiesFilterChanged
in interfaceweka.gui.explorer.Explorer.CapabilitiesFilterChangeListener
- Parameters:
e
- the associated change event
-
setExplorer
public void setExplorer(weka.gui.explorer.Explorer parent)
Sets the Explorer to use as parent frame (used for sending notifications about changes in the data).- Specified by:
setExplorer
in interfaceweka.gui.explorer.Explorer.ExplorerPanel
- Parameters:
parent
- the parent frame
-
getExplorer
public weka.gui.explorer.Explorer getExplorer()
returns the parent Explorer frame.- Specified by:
getExplorer
in interfaceweka.gui.explorer.Explorer.ExplorerPanel
- Returns:
- the parent
-
getTabTitle
public String getTabTitle()
Returns the title for the tab in the Explorer.- Specified by:
getTabTitle
in interfaceweka.gui.explorer.Explorer.ExplorerPanel
- Returns:
- the title of this tab
-
getTabTitleToolTip
public String getTabTitleToolTip()
Returns the tooltip for the tab in the Explorer.- Specified by:
getTabTitleToolTip
in interfaceweka.gui.explorer.Explorer.ExplorerPanel
- Returns:
- the tooltip of this tab
-
main
public static void main(String[] args)
Tests out the Experiment panel from the command line.- Parameters:
args
- may optionally contain the name of a dataset to load.
-
-