Package weka.gui.explorer
Class AbstractPlotInstances
- java.lang.Object
-
- weka.gui.explorer.AbstractPlotInstances
-
- All Implemented Interfaces:
java.io.Serializable,OptionHandler
- Direct Known Subclasses:
ClassifierErrorsPlotInstances,ClustererAssignmentsPlotInstances
public abstract class AbstractPlotInstances extends java.lang.Object implements java.io.Serializable, OptionHandler
Abstract superclass for generating plottable instances.- Version:
- $Revision: 10220 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractPlotInstances()Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanPlot(boolean setup)Returns whether all the data is available and the plot instances can be used for plotting.voidcleanUp()For freeing up memory.InstancesgetInstances()Returns the training data.java.lang.String[]getOptions()Gets the current option settings for the OptionHandler.PlotData2DgetPlotData(java.lang.String name)Assembles and returns the plot.InstancesgetPlotInstances()Returns the generated plot instances.java.util.Enumeration<Option>listOptions()Returns an enumeration of all the available options.voidsetInstances(Instances value)Sets the instances that are the basis for the plot instances.voidsetOptions(java.lang.String[] options)Sets the OptionHandler's options using the given list.voidsetUp()Performs checks, sets up the structure for the plot instances.
-
-
-
Method Detail
-
listOptions
public java.util.Enumeration<Option> listOptions()
Returns an enumeration of all the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- an enumeration of all available options.
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionSets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).- Specified by:
setOptionsin interfaceOptionHandler- Parameters:
options- the list of options as an array of strings- Throws:
java.lang.Exception- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Gets the current option settings for the OptionHandler.- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- the list of current option settings as an array of strings
-
setInstances
public void setInstances(Instances value)
Sets the instances that are the basis for the plot instances.- Parameters:
value- the training data to initialize with
-
getInstances
public Instances getInstances()
Returns the training data.- Returns:
- the training data
-
setUp
public void setUp()
Performs checks, sets up the structure for the plot instances.
-
canPlot
public boolean canPlot(boolean setup)
Returns whether all the data is available and the plot instances can be used for plotting.- Parameters:
setup- whether to call setup as well- Returns:
- true if operational for plotting
-
getPlotInstances
public Instances getPlotInstances()
Returns the generated plot instances.- Returns:
- the instances to plot
-
getPlotData
public PlotData2D getPlotData(java.lang.String name) throws java.lang.Exception
Assembles and returns the plot. The relation name of the dataset gets added automatically.- Parameters:
name- the name of the plot- Returns:
- the plot
- Throws:
java.lang.Exception- if plot generation fails
-
cleanUp
public void cleanUp()
For freeing up memory. Plot data cannot be generated after this call!
-
-