weka.classifiers
Class RandomizableClassifier

java.lang.Object
  extended byweka.classifiers.Classifier
      extended byweka.classifiers.RandomizableClassifier
All Implemented Interfaces:
java.lang.Cloneable, OptionHandler, Randomizable, java.io.Serializable

public abstract class RandomizableClassifier
extends Classifier
implements Randomizable

Abstract utility class for handling settings common to randomizable classifiers.

Version:
$Revision: 1.1 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
protected  int m_Seed
          The random number seed.
 
Fields inherited from class weka.classifiers.Classifier
m_Debug
 
Constructor Summary
RandomizableClassifier()
           
 
Method Summary
 java.lang.String[] getOptions()
          Gets the current settings of the classifier.
 int getSeed()
          Gets the seed for the random number generations
 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options.
 java.lang.String seedTipText()
          Returns the tip text for this property
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 void setSeed(int seed)
          Set the seed for random number generation.
 
Methods inherited from class weka.classifiers.Classifier
buildClassifier, classifyInstance, debugTipText, distributionForInstance, forName, getDebug, makeCopies, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Seed

protected int m_Seed
The random number seed.

Constructor Detail

RandomizableClassifier

public RandomizableClassifier()
Method Detail

listOptions

public java.util.Enumeration listOptions()
Returns an enumeration describing the available options.

Specified by:
listOptions in interface OptionHandler
Overrides:
listOptions in class Classifier
Returns:
an enumeration of all the available options.

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception
Parses a given list of options. Valid options are:

-W classname
Specify the full class name of the base learner.

-I num
Set the number of iterations (default 10).

-S num
Set the random number seed (default 1).

Options after -- are passed to the designated classifier.

Specified by:
setOptions in interface OptionHandler
Overrides:
setOptions in class Classifier
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 settings of the classifier.

Specified by:
getOptions in interface OptionHandler
Overrides:
getOptions in class Classifier
Returns:
an array of strings suitable for passing to setOptions

seedTipText

public java.lang.String seedTipText()
Returns the tip text for this property

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

setSeed

public void setSeed(int seed)
Set the seed for random number generation.

Specified by:
setSeed in interface Randomizable
Parameters:
seed - the seed

getSeed

public int getSeed()
Gets the seed for the random number generations

Specified by:
getSeed in interface Randomizable
Returns:
the seed for the random number generation