weka.classifiers.functions
Class RBFNetwork

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

public class RBFNetwork
extends Classifier
implements OptionHandler

Class that implements a radial basis function network. It uses the K-Means clustering algorithm to provide the basis functions and learns either a logistic regression (discrete class problems) or linear regression (numeric class problems) on top of that.

Valid options are:

-B num
Set the number of clusters (basis functions) to use.

-R ridge
Set the ridge parameter for the logistic regression or linear regression.

-M num
Set the maximum number of iterations for logistic regression. (default -1, until convergence)

-S seed
Set the random seed used by K-means when generating clusters. (default 1).

Version:
$Revision: 1.1 $
Author:
Mark Hall
See Also:
Serialized Form

Field Summary
private  ClusterMembership m_basisFilter
          The filter for producing the meta data
private  int m_clusteringSeed
          The seed to pass on to K-means
private  LinearRegression m_linear
          The linear regression for numeric problems
private  Logistic m_logistic
          The logistic regression for classification problems
private  int m_maxIts
          The maximum number of iterations for logistic regression.
private  int m_numClusters
          The number of clusters (basis functions to generate)
protected  double m_ridge
          The ridge parameter for the logistic regression.
 
Fields inherited from class weka.classifiers.Classifier
m_Debug
 
Constructor Summary
RBFNetwork()
           
 
Method Summary
 void buildClassifier(Instances instances)
          Builds the classifier
 java.lang.String clusteringSeedTipText()
          Returns the tip text for this property
 double[] distributionForInstance(Instance instance)
          Computes the distribution for a given instance
 int getClusteringSeed()
          Get the random seed used by K-means.
 int getMaxIts()
          Get the value of MaxIts.
 int getNumClusters()
          Return the number of clusters to generate.
 java.lang.String[] getOptions()
          Gets the current settings of the classifier.
 double getRidge()
          Gets the ridge value.
 java.lang.String globalInfo()
          Returns a string describing this classifier
 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
static void main(java.lang.String[] argv)
          Main method for testing this class.
 java.lang.String maxItsTipText()
          Returns the tip text for this property
 java.lang.String numClustersTipText()
          Returns the tip text for this property
 java.lang.String ridgeTipText()
          Returns the tip text for this property
 void setClusteringSeed(int seed)
          Set the random seed to be passed on to K-means.
 void setMaxIts(int newMaxIts)
          Set the value of MaxIts.
 void setNumClusters(int numClusters)
          Set the number of clusters for K-means to generate.
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 void setRidge(double ridge)
          Sets the ridge value for logistic or linear regression.
 java.lang.String toString()
          Returns a description of this classifier as a String
 
Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_logistic

private Logistic m_logistic
The logistic regression for classification problems


m_linear

private LinearRegression m_linear
The linear regression for numeric problems


m_basisFilter

private ClusterMembership m_basisFilter
The filter for producing the meta data


m_numClusters

private int m_numClusters
The number of clusters (basis functions to generate)


m_ridge

protected double m_ridge
The ridge parameter for the logistic regression.


m_maxIts

private int m_maxIts
The maximum number of iterations for logistic regression.


m_clusteringSeed

private int m_clusteringSeed
The seed to pass on to K-means

Constructor Detail

RBFNetwork

public RBFNetwork()
Method Detail

globalInfo

public java.lang.String globalInfo()
Returns a string describing this classifier

Returns:
a description of the classifier suitable for displaying in the explorer/experimenter gui

buildClassifier

public void buildClassifier(Instances instances)
                     throws java.lang.Exception
Builds the classifier

Specified by:
buildClassifier in class Classifier
Parameters:
instances - the training data
Throws:
java.lang.Exception - if the classifier could not be built successfully

distributionForInstance

public double[] distributionForInstance(Instance instance)
                                 throws java.lang.Exception
Computes the distribution for a given instance

Overrides:
distributionForInstance in class Classifier
Parameters:
instance - the instance for which distribution is computed
Returns:
the distribution
Throws:
java.lang.Exception - if the distribution can't be computed successfully

toString

public java.lang.String toString()
Returns a description of this classifier as a String

Returns:
a description of this classifier

maxItsTipText

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

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

getMaxIts

public int getMaxIts()
Get the value of MaxIts.

Returns:
Value of MaxIts.

setMaxIts

public void setMaxIts(int newMaxIts)
Set the value of MaxIts.

Parameters:
newMaxIts - Value to assign to MaxIts.

ridgeTipText

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

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

setRidge

public void setRidge(double ridge)
Sets the ridge value for logistic or linear regression.

Parameters:
ridge - the ridge

getRidge

public double getRidge()
Gets the ridge value.

Returns:
the ridge

numClustersTipText

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

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

setNumClusters

public void setNumClusters(int numClusters)
Set the number of clusters for K-means to generate.

Parameters:
numClusters - the number of clusters to generate.

getNumClusters

public int getNumClusters()
Return the number of clusters to generate.

Returns:
the number of clusters to generate.

clusteringSeedTipText

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

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

setClusteringSeed

public void setClusteringSeed(int seed)
Set the random seed to be passed on to K-means.

Parameters:
seed - a seed value.

getClusteringSeed

public int getClusteringSeed()
Get the random seed used by K-means.

Returns:
the seed value.

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:

-B num
Set the number of clusters (basis functions) to use.

-R ridge
Set the ridge parameter for the logistic regression or linear regression.

-M num
Set the maximum number of iterations for logistic regression. (default -1, until convergence)

-S seed
Set the random seed used by K-means when generating clusters. (default 1).

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

main

public static void main(java.lang.String[] argv)
Main method for testing this class.

Parameters:
argv - should contain the command line arguments to the scheme (see Evaluation)