Class 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).
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • 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 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 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 BaseTextField m_FoldsPercText
        Either the number of folds or the percentage for the random split.
      • m_ClassCombo

        protected BaseComboBox m_ClassCombo
        Lets the user select the class column.
      • m_StartBut

        protected BaseButton m_StartBut
        Click to start running the experiment.
      • m_StopBut

        protected 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.
    • Constructor Detail

      • ExperimentPanel

        public ExperimentPanel()
        Creates the Experiment panel.
    • Method Detail

      • setLog

        public void setLog​(weka.gui.Logger newLog)
        Sets the Logger to receive informational messages.
        Specified by:
        setLog in interface weka.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 interface weka.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 user
        x - the x coordinate for popping up the menu
        y - 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 interface weka.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 interface weka.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 interface weka.gui.explorer.Explorer.ExplorerPanel
        Returns:
        the parent
      • getTabTitle

        public String getTabTitle()
        Returns the title for the tab in the Explorer.
        Specified by:
        getTabTitle in interface weka.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 interface weka.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.