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

Class weka.experiment.RemoteExperiment

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

public class RemoteExperiment
extends Experiment
Holds all the necessary configuration information for a distributed experiment. This object is able to be serialized for storage on disk.

This class is experimental at present. Has been tested using CSVResultListener (sending results to standard out) and DatabaseResultListener (InstantDB + RmiJdbc bridge).

Getting started:

Start InstantDB (with the RMI bridge) on some machine. If using java2 then specify -Djava.security.policy=db.policy to the virtual machine. Where db.policy is as follows:

 grant {
   permission java.security.AllPermission;
 };
 

Start RemoteEngine servers on x machines as per the instructons in the README_Experiment_Gui file. There must be a DatabaseUtils.props in either the HOME or current directory of each machine, listing all necessary jdbc drivers.

The machine where a RemoteExperiment is started must also have a copy of DatabaseUtils.props listing the URL to the machine where the database server is running (RmiJdbc + InstantDB).

Here is an example of starting a RemoteExperiment:


 java -Djava.rmi.server.codebase=file:/path to weka classes/ \
 weka.experiment.RemoteExperiment -L 1 -U 10 \
 -T /home/ml/datasets/UCI/iris.arff \
 -D "weka.experiment.DatabaseResultListener" \
 -P "weka.experiment.RandomSplitResultProducer" \
 -h rosebud.cs.waikato.ac.nz -h blackbird.cs.waikato.ac.nz -r -- \
 -W weka.experiment.ClassifierSplitEvaluator -- \
 -W weka.classifiers.NaiveBayes

 

The "codebase" property tells rmi where to serve up weka classes from. This can either be a file url (as long as a shared file system is being used that is accessable by the remoteEngine servers), or http url (which of course supposes that a web server is running and you have put your weka classes somewhere that is web accessable). If using a file url the trailing "/" is *most* important unless the weka classes are in a jar file.

Version:
$Revision: 1.9 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)

Constructor Index

 o RemoteExperiment(Experiment)
Construct a new RemoteExperiment using a base Experiment

Method Index

 o abortExperiment()
Set the abort flag
 o addRemoteExperimentListener(RemoteExperimentListener)
Add an object to the list of those interested in recieving update information from the RemoteExperiment
 o addRemoteHost(String)
Add a host name to the list of remote hosts
 o advanceCounters()
overides the one in Experiment
 o getBaseExperiment()
Get the base experiment used by this remote experiment
 o getRemoteHosts()
Get the list of remote host names
 o getSplitByDataSet()
Returns true if sub experiments are to be created on the basis of data set..
 o initialize()
Prepares a remote experiment for running, creates sub experiments
 o launchNext(int, int)
Launch a sub experiment on a remote host
 o main(String[])
Configures/Runs the Experiment from the command line.
 o nextIteration()
Overides the one in Experiment
 o postProcess()
overides the one in Experiment
 o runExperiment()
Overides runExperiment in Experiment
 o setBaseExperiment(Experiment)
Set the base experiment.
 o setDatasets(DefaultListModel)
Set the datasets to use in the experiment
 o setNotes(String)
Set the user notes.
 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 setSplitByDataSet(boolean)
Set whether sub experiments are to be created on the basis of data set.
 o setUsePropertyIterator(boolean)
Sets whether the custom property iterator should be used.
 o toString()
Overides toString in Experiment

Constructor Detail

 o RemoteExperiment
public RemoteExperiment(Experiment base) throws java.lang.Exception
          Construct a new RemoteExperiment using a base Experiment
Parameters:
base - the base experiment to use

Method Detail

 o getSplitByDataSet
public boolean getSplitByDataSet()
          Returns true if sub experiments are to be created on the basis of data set..
Returns:
a boolean value indicating whether sub experiments are to be created on the basis of data set (true) or run number (false).
 o setSplitByDataSet
public void setSplitByDataSet(boolean sd)
          Set whether sub experiments are to be created on the basis of data set.
Parameters:
sd - true if sub experiments are to be created on the basis of data set. Otherwise sub experiments are created on the basis of run number.
 o addRemoteExperimentListener
public void addRemoteExperimentListener(RemoteExperimentListener r)
          Add an object to the list of those interested in recieving update information from the RemoteExperiment
Parameters:
r - a listener
 o getBaseExperiment
public Experiment getBaseExperiment()
          Get the base experiment used by this remote experiment
Returns:
the base experiment
 o setBaseExperiment
public void setBaseExperiment(Experiment base) throws java.lang.Exception
          Set the base experiment. A sub experiment will be created for each run in the base experiment.
Parameters:
base - the base experiment to use.
Throws:
java.lang.Exception - if supplied base experiment is null
 o setNotes
public void setNotes(java.lang.String newNotes)
          Set the user notes.
Parameters:
newNotes - New user notes.
Overrides:
setNotes in class 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.
Overrides:
setRunLower in class 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.
Overrides:
setRunUpper in class Experiment
 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.
Overrides:
setResultListener in class 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.
Overrides:
setResultProducer in class Experiment
 o setDatasets
public void setDatasets(javax.swing.DefaultListModel ds)
          Set the datasets to use in the experiment
Parameters:
ds - the list of datasets to use
Overrides:
setDatasets in class Experiment
 o setUsePropertyIterator
public void setUsePropertyIterator(boolean newUsePropertyIterator)
          Sets whether the custom property iterator should be used.
Parameters:
newUsePropertyIterator - true if so
Overrides:
setUsePropertyIterator in class Experiment
 o setPropertyPath
public void setPropertyPath(PropertyNode newPropertyPath[])
          Sets the path of properties taken to get to the custom property to iterate over.
Overrides:
setPropertyPath in class Experiment
 o setPropertyArray
public void setPropertyArray(java.lang.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.
Overrides:
setPropertyArray in class Experiment
 o initialize
public void initialize() throws java.lang.Exception
          Prepares a remote experiment for running, creates sub experiments
Throws:
java.lang.Exception - if an error occurs
Overrides:
initialize in class Experiment
 o abortExperiment
public void abortExperiment()
          Set the abort flag
 o launchNext
public void launchNext(int wexp,
                       int ah)
          Launch a sub experiment on a remote host
Parameters:
wexp - the index of the sub experiment to launch
ah - the index of the available host to launch on
 o nextIteration
public void nextIteration() throws java.lang.Exception
          Overides the one in Experiment
Throws:
java.lang.Exception -
Overrides:
nextIteration in class Experiment
 o advanceCounters
public void advanceCounters()
          overides the one in Experiment
Overrides:
advanceCounters in class Experiment
 o postProcess
public void postProcess()
          overides the one in Experiment
Overrides:
postProcess in class Experiment
 o addRemoteHost
public void addRemoteHost(java.lang.String hostname)
          Add a host name to the list of remote hosts
Parameters:
hostname - the host name to add to the list
 o getRemoteHosts
public javax.swing.DefaultListModel getRemoteHosts()
          Get the list of remote host names
Returns:
the list of remote host names
 o toString
public java.lang.String toString()
          Overides toString in Experiment
Returns:
a description of this remote experiment
Overrides:
toString in class Experiment
 o runExperiment
public void runExperiment()
          Overides runExperiment in Experiment
Overrides:
runExperiment in class Experiment
 o main
public static void main(java.lang.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