weka.classifiers.functions
Class RBFModel

java.lang.Object
  extended by weka.classifiers.AbstractClassifier
      extended by weka.classifiers.RandomizableClassifier
          extended by weka.classifiers.functions.RBFModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Classifier, CapabilitiesHandler, OptionHandler, Randomizable, RevisionHandler
Direct Known Subclasses:
RBFClassifier, RBFRegressor

public abstract class RBFModel
extends RandomizableClassifier

Abstract super class that can be extended by sub classes that learn RBF models.

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

Field Summary
static Tag[] TAGS_SCALE
           
static int USE_GLOBAL_SCALE
          Constants for scale optimization options
static int USE_SCALE_PER_UNIT
           
static int USE_SCALE_PER_UNIT_AND_ATTRIBUTE
           
 
Constructor Summary
RBFModel()
           
 
Method Summary
 void buildClassifier(Instances data)
          Builds the RBF network regressor based on the given dataset.
 double[] distributionForInstance(Instance inst)
          Calculates the output of the network after the instance has been piped through the fliters to replace missing values, etc.
 Capabilities getCapabilities()
          Returns default capabilities of the classifier.
 int getNumFunctions()
          Gets the number of functions.
 int getNumThreads()
          Gets the number of threads.
 java.lang.String[] getOptions()
          Gets the current settings of the Classifier.
 int getPoolSize()
          Gets the number of threads.
 double getRidge()
          Gets the value of the ridge parameter.
 SelectedTag getScaleOptimizationOption()
          Gets the scale optimisation method to use.
 double getTolerance()
          Gets the tolerance parameter for the delta values.
 boolean getUseAttributeWeights()
          Gets whether to use attribute weights
 boolean getUseCGD()
          Gets whether to use CGD.
 boolean getUseNormalizedBasisFunctions()
          Gets whether to use normalized basis functions.
 java.lang.String globalInfo()
          This will return a string describing the classifier.
 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options.
 java.lang.String numFunctionsTipText()
           
 java.lang.String numThreadsTipText()
           
 java.lang.String poolSizeTipText()
           
 java.lang.String ridgeTipText()
           
 java.lang.String scaleOptimizationOptionTipText()
           
 void setNumFunctions(int newNumFunctions)
          Sets the number of functions.
 void setNumThreads(int nT)
          Sets the number of threads
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 void setPoolSize(int nT)
          Sets the number of threads
 void setRidge(double newRidge)
          Sets the value of the ridge parameter.
 void setScaleOptimizationOption(SelectedTag newMethod)
          Sets the scale optimization option to use.
 void setTolerance(double newTolerance)
          Sets the tolerance parameter for the delta values.
 void setUseAttributeWeights(boolean newUseAttributeWeights)
          Sets whether to use attribute weights.
 void setUseCGD(boolean newUseCGD)
          Sets whether to use CGD.
 void setUseNormalizedBasisFunctions(boolean newUseNormalizedBasisFunctions)
          Sets whether to use normalized basis functions.
 java.lang.String toleranceTipText()
           
 java.lang.String useAttributeWeightsTipText()
           
 java.lang.String useCGDTipText()
           
 java.lang.String useNormalizedBasisFunctionsTipText()
           
 
Methods inherited from class weka.classifiers.RandomizableClassifier
getSeed, seedTipText, setSeed
 
Methods inherited from class weka.classifiers.AbstractClassifier
classifyInstance, debugTipText, forName, getDebug, getRevision, makeCopies, makeCopy, runClassifier, setDebug
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_GLOBAL_SCALE

public static final int USE_GLOBAL_SCALE
Constants for scale optimization options

See Also:
Constant Field Values

USE_SCALE_PER_UNIT

public static final int USE_SCALE_PER_UNIT
See Also:
Constant Field Values

USE_SCALE_PER_UNIT_AND_ATTRIBUTE

public static final int USE_SCALE_PER_UNIT_AND_ATTRIBUTE
See Also:
Constant Field Values

TAGS_SCALE

public static final Tag[] TAGS_SCALE
Constructor Detail

RBFModel

public RBFModel()
Method Detail

getCapabilities

public Capabilities getCapabilities()
Returns default capabilities of the classifier.

Specified by:
getCapabilities in interface Classifier
Specified by:
getCapabilities in interface CapabilitiesHandler
Overrides:
getCapabilities in class AbstractClassifier
Returns:
the capabilities of this classifier

buildClassifier

public void buildClassifier(Instances data)
                     throws java.lang.Exception
Builds the RBF network regressor based on the given dataset.

Throws:
java.lang.Exception

distributionForInstance

public double[] distributionForInstance(Instance inst)
                                 throws java.lang.Exception
Calculates the output of the network after the instance has been piped through the fliters to replace missing values, etc.

Specified by:
distributionForInstance in interface Classifier
Overrides:
distributionForInstance in class AbstractClassifier
Throws:
java.lang.Exception

globalInfo

public java.lang.String globalInfo()
This will return a string describing the classifier.

Returns:
The string.

toleranceTipText

public java.lang.String toleranceTipText()
Returns:
a string to describe the option

getTolerance

public double getTolerance()
Gets the tolerance parameter for the delta values.


setTolerance

public void setTolerance(double newTolerance)
Sets the tolerance parameter for the delta values.


numFunctionsTipText

public java.lang.String numFunctionsTipText()
Returns:
a string to describe the option

getNumFunctions

public int getNumFunctions()
Gets the number of functions.


setNumFunctions

public void setNumFunctions(int newNumFunctions)
Sets the number of functions.


ridgeTipText

public java.lang.String ridgeTipText()
Returns:
a string to describe the option

getRidge

public double getRidge()
Gets the value of the ridge parameter.


setRidge

public void setRidge(double newRidge)
Sets the value of the ridge parameter.


useCGDTipText

public java.lang.String useCGDTipText()
Returns:
a string to describe the option

getUseCGD

public boolean getUseCGD()
Gets whether to use CGD.


setUseCGD

public void setUseCGD(boolean newUseCGD)
Sets whether to use CGD.


useAttributeWeightsTipText

public java.lang.String useAttributeWeightsTipText()
Returns:
a string to describe the option

getUseAttributeWeights

public boolean getUseAttributeWeights()
Gets whether to use attribute weights


setUseAttributeWeights

public void setUseAttributeWeights(boolean newUseAttributeWeights)
Sets whether to use attribute weights.


useNormalizedBasisFunctionsTipText

public java.lang.String useNormalizedBasisFunctionsTipText()
Returns:
a string to describe the option

getUseNormalizedBasisFunctions

public boolean getUseNormalizedBasisFunctions()
Gets whether to use normalized basis functions.


setUseNormalizedBasisFunctions

public void setUseNormalizedBasisFunctions(boolean newUseNormalizedBasisFunctions)
Sets whether to use normalized basis functions.


scaleOptimizationOptionTipText

public java.lang.String scaleOptimizationOptionTipText()
Returns:
a string to describe the option

getScaleOptimizationOption

public SelectedTag getScaleOptimizationOption()
Gets the scale optimisation method to use.


setScaleOptimizationOption

public void setScaleOptimizationOption(SelectedTag newMethod)
Sets the scale optimization option to use.


numThreadsTipText

public java.lang.String numThreadsTipText()
Returns:
a string to describe the option

getNumThreads

public int getNumThreads()
Gets the number of threads.


setNumThreads

public void setNumThreads(int nT)
Sets the number of threads


poolSizeTipText

public java.lang.String poolSizeTipText()
Returns:
a string to describe the option

getPoolSize

public int getPoolSize()
Gets the number of threads.


setPoolSize

public void setPoolSize(int nT)
Sets the number of threads


listOptions

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

Specified by:
listOptions in interface OptionHandler
Overrides:
listOptions in class RandomizableClassifier
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:

 -N
  Number of Gaussian basis functions (default is 2).
 
 -R
  Ridge factor for quadratic penalty on output weights (default is 0.01).
 
 -C
  The scale optimization option: global scale (1), one scale per unit (2), scale per unit and attribute (3) (default is 2).
 
 -G
  Use conjugate gradient descent (recommended for many attributes).
 
 -O
  Use normalized basis functions.
 
 -A
  Use attribute weights.
 
 -S <num>
  Random number seed.
  (default 1)
 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
Options after -- are passed to the designated classifier.

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