RBFKernel (original) (raw)
java.lang.Object
- weka.classifiers.functions.supportVector.Kernel
- weka.classifiers.functions.supportVector.CachedKernel
- weka.classifiers.functions.supportVector.RBFKernel
- weka.classifiers.functions.supportVector.CachedKernel
All Implemented Interfaces:
java.io.Serializable, CapabilitiesHandler, OptionHandler, RevisionHandler
Direct Known Subclasses:
MIRBFKernel
public class RBFKernel
extends CachedKernel
The RBF kernel. K(x, y) = e^-(gamma * <x-y, x-y>^2)
Valid options are:
-D
Enables debugging output (if available) to be printed.
(default: off)
-no-checks
Turns off all checks - use with caution!
(default: checks on)
-C
The size of the cache (a prime number), 0 for full cache and
-1 to turn it off.
(default: 250007)
-G
The Gamma parameter.
(default: 0.01)
Version: Revision:5518Revision: 5518 Revision:5518
Author:
Eibe Frank (eibe@cs.waikato.ac.nz), Shane Legg (shane@intelligenesis.net) (sparse vector code), Stuart Inglis (stuart@reeltwo.com) (sparse vector code), J. Lindgren (jtlindgr{at}cs.helsinki.fi) (RBF kernel)
See Also:
Serialized Form
Constructor Summary
Constructors
Constructor and Description RBFKernel() default constructor - does nothing. RBFKernel(Instances data, int cacheSize, double gamma) Constructor. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description void buildKernel(Instances data) builds the kernel with the given data. java.lang.String gammaTipText() Returns the tip text for this property Capabilities getCapabilities() Returns the Capabilities of this kernel. double getGamma() Gets the gamma value. java.lang.String[] getOptions() Gets the current settings of the Kernel. java.lang.String getRevision() Returns the revision string. java.lang.String globalInfo() Returns a string describing the kernel java.util.Enumeration listOptions() Returns an enumeration describing the available options. void setGamma(double value) Sets the gamma value. void setOptions(java.lang.String[] options) Parses a given list of options. java.lang.String toString() returns a string representation for the Kernel * ### Methods inherited from class weka.classifiers.functions.supportVector.[CachedKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html "class in weka.classifiers.functions.supportVector") `[cacheSizeTipText](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#cacheSizeTipText--), [clean](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#clean--), [eval](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#eval-int-int-weka.core.Instance-), [getCacheSize](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#getCacheSize--), [numCacheHits](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#numCacheHits--), [numEvals](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#numEvals--), [setCacheSize](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#setCacheSize-int-)` * ### Methods inherited from class weka.classifiers.functions.supportVector.[Kernel](../../../../weka/classifiers/functions/supportVector/Kernel.html "class in weka.classifiers.functions.supportVector") `[checksTurnedOffTipText](../../../../weka/classifiers/functions/supportVector/Kernel.html#checksTurnedOffTipText--), [debugTipText](../../../../weka/classifiers/functions/supportVector/Kernel.html#debugTipText--), [forName](../../../../weka/classifiers/functions/supportVector/Kernel.html#forName-java.lang.String-java.lang.String:A-), [getChecksTurnedOff](../../../../weka/classifiers/functions/supportVector/Kernel.html#getChecksTurnedOff--), [getDebug](../../../../weka/classifiers/functions/supportVector/Kernel.html#getDebug--), [makeCopies](../../../../weka/classifiers/functions/supportVector/Kernel.html#makeCopies-weka.classifiers.functions.supportVector.Kernel-int-), [makeCopy](../../../../weka/classifiers/functions/supportVector/Kernel.html#makeCopy-weka.classifiers.functions.supportVector.Kernel-), [setChecksTurnedOff](../../../../weka/classifiers/functions/supportVector/Kernel.html#setChecksTurnedOff-boolean-), [setDebug](../../../../weka/classifiers/functions/supportVector/Kernel.html#setDebug-boolean-)` * ### Methods inherited from class java.lang.Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
Constructor Detail
* #### RBFKernel public RBFKernel() default constructor - does nothing. * #### RBFKernel public RBFKernel([Instances](../../../../weka/core/Instances.html "class in weka.core") data, int cacheSize, double gamma) throws java.lang.Exception Constructor. Initializes m\_kernelPrecalc\[\]. Parameters: `data` \- the data to use `cacheSize` \- the size of the cache `gamma` \- the bandwidth Throws: `java.lang.Exception` \- if something goes wrong
Method Detail
* #### globalInfo public java.lang.String globalInfo() Returns a string describing the kernel Specified by: `[globalInfo](../../../../weka/classifiers/functions/supportVector/Kernel.html#globalInfo--)` in class `[Kernel](../../../../weka/classifiers/functions/supportVector/Kernel.html "class in weka.classifiers.functions.supportVector")` Returns: a description suitable for displaying in the explorer/experimenter gui * #### 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/functions/supportVector/CachedKernel.html#listOptions--)` in class `[CachedKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html "class in weka.classifiers.functions.supportVector")` 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: -D Enables debugging output (if available) to be printed. (default: off) -no-checks Turns off all checks - use with caution! (default: checks on) -C <num> The size of the cache (a prime number), 0 for full cache and -1 to turn it off. (default: 250007) -G <num> The Gamma parameter. (default: 0.01) 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/functions/supportVector/CachedKernel.html#setOptions-java.lang.String:A-)` in class `[CachedKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html "class in weka.classifiers.functions.supportVector")` 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 Kernel. Specified by: `[getOptions](../../../../weka/core/OptionHandler.html#getOptions--)` in interface `[OptionHandler](../../../../weka/core/OptionHandler.html "interface in weka.core")` Overrides: `[getOptions](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#getOptions--)` in class `[CachedKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html "class in weka.classifiers.functions.supportVector")` Returns: an array of strings suitable for passing to setOptions * #### setGamma public void setGamma(double value) Sets the gamma value. Parameters: `value` \- the gamma value * #### getGamma public double getGamma() Gets the gamma value. Returns: the gamma value * #### gammaTipText public java.lang.String gammaTipText() Returns the tip text for this property Returns: tip text for this property suitable for displaying in the explorer/experimenter gui * #### getCapabilities public [Capabilities](../../../../weka/core/Capabilities.html "class in weka.core") getCapabilities() Returns the Capabilities of this kernel. Specified by: `[getCapabilities](../../../../weka/core/CapabilitiesHandler.html#getCapabilities--)` in interface `[CapabilitiesHandler](../../../../weka/core/CapabilitiesHandler.html "interface in weka.core")` Overrides: `[getCapabilities](../../../../weka/classifiers/functions/supportVector/Kernel.html#getCapabilities--)` in class `[Kernel](../../../../weka/classifiers/functions/supportVector/Kernel.html "class in weka.classifiers.functions.supportVector")` Returns: the capabilities of this object See Also: [Capabilities](../../../../weka/core/Capabilities.html "class in weka.core") * #### buildKernel public void buildKernel([Instances](../../../../weka/core/Instances.html "class in weka.core") data) throws java.lang.Exception builds the kernel with the given data. Initializes the kernel cache. The actual size of the cache in bytes is (64 \* cacheSize). Overrides: `[buildKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#buildKernel-weka.core.Instances-)` in class `[CachedKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html "class in weka.classifiers.functions.supportVector")` Parameters: `data` \- the data to base the kernel on Throws: `java.lang.Exception` \- if something goes wrong * #### toString public java.lang.String toString() returns a string representation for the Kernel Overrides: `toString` in class `java.lang.Object` Returns: a string representaiton of the kernel * #### 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/functions/supportVector/Kernel.html#getRevision--)` in class `[Kernel](../../../../weka/classifiers/functions/supportVector/Kernel.html "class in weka.classifiers.functions.supportVector")` Returns: the revision