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

Class weka.experiment.Experiment

java.lang.Object
   |
   +----weka.experiment.Experiment

public class Experiment
extends Object
implements Serializable, OptionHandler
Holds all the necessary configuration information for a standard type experiment. This object is able to be serialized for storage on disk.

Version:
$Revision: 1.3 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o Experiment()

Method Index

 o advanceCounters()
Increments iteration counters appropriately.
 o getCurrentDatasetNumber()
When an experiment is running, this returns the current dataset number.
 o getCurrentPropertyNumber()
When an experiment is running, this returns the index of the current custom property value.
 o getCurrentRunNumber()
When an experiment is running, this returns the current run number.
 o getDatasets()
Gets the datasets in the experiment.
 o getNotes()
Get the user notes.
 o getOptions()
Gets the current settings of the experiment iterator.
 o getPropertyArray()
Gets the array of values to set the custom property to.
 o getPropertyArrayLength()
Gets the number of custom iterator values that have been defined for the experiment.
 o getPropertyArrayValue(int)
Gets a specified value from the custom property iterator array.
 o getPropertyPath()
Gets the path of properties taken to get to the custom property to iterate over.
 o getResultListener()
Gets the result listener where results will be sent.
 o getResultProducer()
Get the result producer used for the current experiment.
 o getRunLower()
Get the lower run number for the experiment.
 o getRunUpper()
Get the upper run number for the experiment.
 o getUsePropertyIterator()
Gets whether the custom property iterator should be used.
 o hasMoreIterations()
Returns true if there are more iterations to carry out in the experiment.
 o initialize()
Prepares an experiment for running, initializing current iterator settings.
 o listOptions()
Returns an enumeration describing the available options.
 o main(String[])
Configures/Runs the Experiment from the command line.
 o nextIteration()
Carries out the next iteration of the experiment.
 o postProcess()
Signals that the experiment is finished running, so that cleanup can be done.
 o runExperiment()
Runs all iterations of the experiment, continuing past errors.
 o setNotes(String)
Set the user notes.
 o setOptions(String[])
Parses a given list of options.
 o setPropertyArray(Object)
Sets the array of values to set the custom property to.
 o setPropertyPath(PropertyNode[])
Sets the path of properties taken to get to the custom property to iterate over.
 o setResultListener(ResultListener)
Sets the result listener where results will be sent.
 o setResultProducer(ResultProducer)
Set the result producer used for the current experiment.
 o setRunLower(int)
Set the lower run number for the experiment.
 o setRunUpper(int)
Set the upper run number for the experiment.
 o setUsePropertyIterator(boolean)
Sets whether the custom property iterator should be used.
 o toString()
Gets a string representation of the experiment configuration.

Constructors

 o Experiment
 public Experiment()

Methods

 o getUsePropertyIterator
 public boolean getUsePropertyIterator()
Gets whether the custom property iterator should be used.

Returns:
true if so
 o setUsePropertyIterator
 public void setUsePropertyIterator(boolean newUsePropertyIterator)
Sets whether the custom property iterator should be used.

Parameters:
newUsePropertyIterator - true if so
 o getPropertyPath
 public PropertyNode[] getPropertyPath()
Gets the path of properties taken to get to the custom property to iterate over.

Returns:
an array of PropertyNodes
 o setPropertyPath
 public void setPropertyPath(PropertyNode newPropertyPath[])
Sets the path of properties taken to get to the custom property to iterate over.

 o setPropertyArray
 public void setPropertyArray(Object newPropArray)
Sets the array of values to set the custom property to.

Parameters:
newPropArray - a value of type Object which should be an array of the appropriate values.
 o getPropertyArray
 public Object getPropertyArray()
Gets the array of values to set the custom property to.

Returns:
a value of type Object which should be an array of the appropriate values.
 o getPropertyArrayLength
 public int getPropertyArrayLength()
Gets the number of custom iterator values that have been defined for the experiment.

Returns:
the number of custom property iterator values.
 o getPropertyArrayValue
 public Object getPropertyArrayValue(int index)
Gets a specified value from the custom property iterator array.

Parameters:
index - the index of the value wanted
Returns:
the property array value
 o getCurrentRunNumber
 public int getCurrentRunNumber()
When an experiment is running, this returns the current run number.

Returns:
the current run number.
 o getCurrentDatasetNumber
 public int getCurrentDatasetNumber()
When an experiment is running, this returns the current dataset number.

Returns:
the current dataset number.
 o getCurrentPropertyNumber
 public int getCurrentPropertyNumber()
When an experiment is running, this returns the index of the current custom property value.

Returns:
the index of the current custom property value.
 o initialize
 public void initialize() throws Exception
Prepares an experiment for running, initializing current iterator settings.

Throws: Exception
if an error occurs
 o hasMoreIterations
 public boolean hasMoreIterations()
Returns true if there are more iterations to carry out in the experiment.

Returns:
true if so
 o nextIteration
 public void nextIteration() throws Exception
Carries out the next iteration of the experiment.

Throws: Exception
if an error occurs
 o advanceCounters
 public void advanceCounters()
Increments iteration counters appropriately.

 o runExperiment
 public void runExperiment()
Runs all iterations of the experiment, continuing past errors.

 o postProcess
 public void postProcess() throws Exception
Signals that the experiment is finished running, so that cleanup can be done.

Throws: Exception
if an error occurs
 o getDatasets
 public DefaultListModel getDatasets()
Gets the datasets in the experiment.

Returns:
the datasets in the experiment.
 o getResultListener
 public ResultListener getResultListener()
Gets the result listener where results will be sent.

Returns:
the result listener where results will be sent.
 o setResultListener
 public void setResultListener(ResultListener newResultListener)
Sets the result listener where results will be sent.

Parameters:
newResultListener - the result listener where results will be sent.
 o getResultProducer
 public ResultProducer getResultProducer()
Get the result producer used for the current experiment.

Returns:
the result producer used for the current experiment.
 o setResultProducer
 public void setResultProducer(ResultProducer newResultProducer)
Set the result producer used for the current experiment.

Parameters:
newResultProducer - result producer to use for the current experiment.
 o getRunUpper
 public int getRunUpper()
Get the upper run number for the experiment.

Returns:
the upper run number for the experiment.
 o setRunUpper
 public void setRunUpper(int newRunUpper)
Set the upper run number for the experiment.

Parameters:
newRunUpper - the upper run number for the experiment.
 o getRunLower
 public int getRunLower()
Get the lower run number for the experiment.

Returns:
the lower run number for the experiment.
 o setRunLower
 public void setRunLower(int newRunLower)
Set the lower run number for the experiment.

Parameters:
newRunLower - the lower run number for the experiment.
 o getNotes
 public String getNotes()
Get the user notes.

Returns:
User notes associated with the experiment.
 o setNotes
 public void setNotes(String newNotes)
Set the user notes.

Parameters:
newNotes - New user notes.
 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options.

Returns:
an enumeration of all the available options
 o setOptions
 public void setOptions(String options[]) throws Exception
Parses a given list of options. Valid options are:

-L num
The lower run number to start the experiment from. (default 1)

-U num
The upper run number to end the experiment at (inclusive). (default 10)

-T arff_file
The dataset to run the experiment on. (required, may be specified multiple times)

-P class_name
The full class name of a ResultProducer (required). eg: weka.experiment.RandomSplitResultProducer

-D class_name
The full class name of a ResultListener (required). eg: weka.experiment.CSVResultListener

All option after -- will be passed to the result producer (there is currently no way to pass options to the result listener).

Parameters:
options - the list of options as an array of strings
Throws: Exception
if an option is not supported
 o getOptions
 public String[] getOptions()
Gets the current settings of the experiment iterator.

Returns:
an array of strings suitable for passing to setOptions
 o toString
 public String toString()
Gets a string representation of the experiment configuration.

Returns:
a value of type 'String'
Overrides:
toString in class Object
 o main
 public static void main(String args[])
Configures/Runs the Experiment from the command line.

Parameters:
args - command line arguments to the Experiment.

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