RBFNetwork (original) (raw)
java.lang.Object
- weka.classifiers.Classifier
- weka.classifiers.functions.RBFNetwork
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CapabilitiesHandler, OptionHandler, RevisionHandler
public class RBFNetwork
extends Classifier
implements OptionHandler
Class that implements a normalized Gaussian radial basisbasis 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. Symmetric multivariate Gaussians are fit to the data from each cluster. If the class is nominal it uses the given number of clusters per class.It standardizes all numeric attributes to zero mean and unit variance.
Valid options are:
-B
Set the number of clusters (basis functions) to generate. (default = 2).
-S
Set the random seed to be used by K-means. (default = 1).
-R
Set the ridge value for the logistic or linear regression.
-M
Set the maximum number of iterations for the logistic regression. (default -1, until convergence).
-W
Set the minimum standard deviation for the clusters. (default 0.1).
Version: Revision:1.10Revision: 1.10 Revision:1.10
Author:
Mark Hall, Eibe Frank
See Also:
Serialized Form
Constructor Summary
Constructors
Constructor and Description RBFNetwork() Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type Method and Description 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 Capabilities getCapabilities() Returns default capabilities of the classifier, i.e., and "or" of Logistic and LinearRegression. int getClusteringSeed() Get the random seed used by K-means. int getMaxIts() Get the value of MaxIts. double getMinStdDev() Get the MinStdDev value. int getNumClusters() Return the number of clusters to generate. java.lang.String[] getOptions() Gets the current settings of the classifier. java.lang.String getRevision() Returns the revision string. 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 minStdDevTipText() 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 setMinStdDev(double newMinStdDev) Set the MinStdDev value. 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](../../../weka/classifiers/Classifier.html "class in weka.classifiers") `[classifyInstance](../../../weka/classifiers/Classifier.html#classifyInstance-weka.core.Instance-), [debugTipText](../../../weka/classifiers/Classifier.html#debugTipText--), [forName](../../../weka/classifiers/Classifier.html#forName-java.lang.String-java.lang.String:A-), [getDebug](../../../weka/classifiers/Classifier.html#getDebug--), [makeCopies](../../../weka/classifiers/Classifier.html#makeCopies-weka.classifiers.Classifier-int-), [makeCopy](../../../weka/classifiers/Classifier.html#makeCopy-weka.classifiers.Classifier-), [setDebug](../../../weka/classifiers/Classifier.html#setDebug-boolean-)` * ### Methods inherited from class java.lang.Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
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 * #### getCapabilities public [Capabilities](../../../weka/core/Capabilities.html "class in weka.core") getCapabilities() Returns default capabilities of the classifier, i.e., and "or" of Logistic and LinearRegression. Specified by: `[getCapabilities](../../../weka/core/CapabilitiesHandler.html#getCapabilities--)` in interface `[CapabilitiesHandler](../../../weka/core/CapabilitiesHandler.html "interface in weka.core")` Overrides: `[getCapabilities](../../../weka/classifiers/Classifier.html#getCapabilities--)` in class `[Classifier](../../../weka/classifiers/Classifier.html "class in weka.classifiers")` Returns: the capabilities of this classifier See Also: [Logistic](../../../weka/classifiers/functions/Logistic.html "class in weka.classifiers.functions"), [LinearRegression](../../../weka/classifiers/functions/LinearRegression.html "class in weka.classifiers.functions") * #### buildClassifier public void buildClassifier([Instances](../../../weka/core/Instances.html "class in weka.core") instances) throws java.lang.Exception Builds the classifier Specified by: `[buildClassifier](../../../weka/classifiers/Classifier.html#buildClassifier-weka.core.Instances-)` in class `[Classifier](../../../weka/classifiers/Classifier.html "class in weka.classifiers")` Parameters: `instances` \- the training data Throws: `java.lang.Exception` \- if the classifier could not be built successfully * #### distributionForInstance public double[] distributionForInstance([Instance](../../../weka/core/Instance.html "class in weka.core") instance) throws java.lang.Exception Computes the distribution for a given instance Overrides: `[distributionForInstance](../../../weka/classifiers/Classifier.html#distributionForInstance-weka.core.Instance-)` in class `[Classifier](../../../weka/classifiers/Classifier.html "class in weka.classifiers")` 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 Overrides: `toString` in class `java.lang.Object` 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. * #### minStdDevTipText public java.lang.String minStdDevTipText() Returns the tip text for this property Returns: tip text for this property suitable for displaying in the explorer/experimenter gui * #### getMinStdDev public double getMinStdDev() Get the MinStdDev value. Returns: the MinStdDev value. * #### setMinStdDev public void setMinStdDev(double newMinStdDev) Set the MinStdDev value. Parameters: `newMinStdDev` \- The new MinStdDev value. * #### listOptions public java.util.Enumeration listOptions() Returns an enumeration describing the available options Specified by: `[listOptions](../../../weka/core/OptionHandler.html#listOptions--)` in interface `[OptionHandler](../../../weka/core/OptionHandler.html "interface in weka.core")` Overrides: `[listOptions](../../../weka/classifiers/Classifier.html#listOptions--)` in class `[Classifier](../../../weka/classifiers/Classifier.html "class in weka.classifiers")` 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 <number> Set the number of clusters (basis functions) to generate. (default = 2). -S <seed> Set the random seed to be used by K-means. (default = 1). -R <ridge> Set the ridge value for the logistic or linear regression. -M <number> Set the maximum number of iterations for the logistic regression. (default -1, until convergence). -W <number> Set the minimum standard deviation for the clusters. (default 0.1). Specified by: `[setOptions](../../../weka/core/OptionHandler.html#setOptions-java.lang.String:A-)` in interface `[OptionHandler](../../../weka/core/OptionHandler.html "interface in weka.core")` Overrides: `[setOptions](../../../weka/classifiers/Classifier.html#setOptions-java.lang.String:A-)` in class `[Classifier](../../../weka/classifiers/Classifier.html "class in weka.classifiers")` 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](../../../weka/core/OptionHandler.html#getOptions--)` in interface `[OptionHandler](../../../weka/core/OptionHandler.html "interface in weka.core")` Overrides: `[getOptions](../../../weka/classifiers/Classifier.html#getOptions--)` in class `[Classifier](../../../weka/classifiers/Classifier.html "class in weka.classifiers")` Returns: an array of strings suitable for passing to setOptions * #### getRevision public java.lang.String getRevision() Returns the revision string. Specified by: `[getRevision](../../../weka/core/RevisionHandler.html#getRevision--)` in interface `[RevisionHandler](../../../weka/core/RevisionHandler.html "interface in weka.core")` Overrides: `[getRevision](../../../weka/classifiers/Classifier.html#getRevision--)` in class `[Classifier](../../../weka/classifiers/Classifier.html "class in weka.classifiers")` Returns: the revision * #### 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)