weka.classifiers.meta.generators
Class Generator

java.lang.Object
  extended by weka.classifiers.meta.generators.Generator
All Implemented Interfaces:
java.io.Serializable, OptionHandler
Direct Known Subclasses:
RandomizableGenerator

public abstract class Generator
extends java.lang.Object
implements java.io.Serializable, OptionHandler

An artificial data generator.

Version:
$Revision: 5861 $
Author:
Kathryn Hempstalk (kah18 at cs.waikato.ac.nz)
See Also:
Serialized Form

Constructor Summary
Generator()
           
 
Method Summary
 Generator copy()
          Clones this generator.
 java.lang.String debugTipText()
          Returns the tip text for this property.
static Generator forName(java.lang.String generatorName, java.lang.String[] options)
          Creates a new instance of a generator given it's class name and (optional) arguments to pass to it's setOptions method.
abstract  double generate()
          Generates a value that falls under this distribution.
 boolean getDebug()
          Get whether debugging is turned on.
abstract  double getLogProbabilityOf(double somedata)
          Gets the (natural) log of the probability of a given value.
 java.lang.String[] getOptions()
          Gets the current settings of the Classifier.
abstract  double getProbabilityOf(double somedata)
          Gets the probability that a value falls under this distribution.
abstract  java.lang.String globalInfo()
          Returns a string describing this class' ability.
 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options.
 void setDebug(boolean debug)
          Set debugging mode.
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generator

public Generator()
Method Detail

getProbabilityOf

public abstract double getProbabilityOf(double somedata)
Gets the probability that a value falls under this distribution.

Parameters:
somedata - The value to get the probability of.
Returns:
The probability of the given value.

getLogProbabilityOf

public abstract double getLogProbabilityOf(double somedata)
Gets the (natural) log of the probability of a given value.

Parameters:
somedata - The value to get the log probability of.
Returns:
The (natural) log of the probability.

generate

public abstract double generate()
Generates a value that falls under this distribution.

Returns:
A generated value.

copy

public Generator copy()
Clones this generator. It is a shallow copy, only settings are copied, not probabilities.

Returns:
A copy of this generator.

forName

public static Generator forName(java.lang.String generatorName,
                                java.lang.String[] options)
                         throws java.lang.Exception
Creates a new instance of a generator given it's class name and (optional) arguments to pass to it's setOptions method. If the classifier implements OptionHandler and the options parameter is non-null, the classifier will have it's options set.

Parameters:
generatorName - the fully qualified class name of the generator
options - an array of options suitable for passing to setOptions. May be null.
Returns:
the newly created classifier, ready for use.
Throws:
java.lang.Exception - if the classifier name is invalid, or the options supplied are not acceptable to the classifier

globalInfo

public abstract java.lang.String globalInfo()
Returns a string describing this class' ability.

Returns:
A description of the class.

listOptions

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

Specified by:
listOptions in interface OptionHandler
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.

Specified by:
setOptions in interface OptionHandler
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
Returns:
an array of strings suitable for passing to setOptions

setDebug

public void setDebug(boolean debug)
Set debugging mode.

Parameters:
debug - true if debug output should be printed

getDebug

public boolean getDebug()
Get whether debugging is turned on.

Returns:
true if debugging output is on

debugTipText

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

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