Class RBFKernel
java.lang.Object
weka.classifiers.functions.supportVector.Kernel
weka.classifiers.functions.supportVector.CachedKernel
weka.classifiers.functions.supportVector.RBFKernel
- All Implemented Interfaces:
Serializable,CapabilitiesHandler,OptionHandler,RevisionHandler
The RBF kernel : K(x, y) = exp(-gamma*(x-y)^2)
Valid options are:
Valid options are:
-C <num> The size of the cache (a prime number), 0 for full cache and -1 to turn it off. (default: 250007)
-G <double> The value to use for the gamma parameter (default: 0.01).
-output-debug-info Enables debugging output (if available) to be printed. (default: off)
- Version:
- $Revision: 14512 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz), Shane Legg (shane@intelligenesis.net) (sparse vector code), Stuart Inglis (stuart@reeltwo.com) (sparse vector code)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildKernel(Instances data) Builds the kernel.Returns the tip text for this propertyReturns the Capabilities of this kernel.doublegetGamma()Gets the gamma value.Returns the revision string.Returns a string describing the kernelvoidsetGamma(double value) Sets the gamma value.toString()returns a string representation for the KernelMethods inherited from class weka.classifiers.functions.supportVector.CachedKernel
cacheSizeTipText, clean, eval, getCacheSize, getOptions, listOptions, numCacheHits, numEvals, setCacheSize, setOptionsMethods inherited from class weka.classifiers.functions.supportVector.Kernel
debugTipText, forName, getChecksTurnedOff, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, setChecksTurnedOff, setDebug, setDoNotCheckCapabilities
-
Constructor Details
-
RBFKernel
public RBFKernel()default constructor - does nothing. -
RBFKernel
Creates a newRBFKernelinstance.- Parameters:
data- the training dataset used.cacheSize- the size of the cache (a prime number)gamma- the gamma to use- Throws:
Exception- if something goes wrong
-
-
Method Details
-
buildKernel
Builds the kernel. Calls the super class method and then also initializes the cache for the diagonal of the dot product matrix.- Overrides:
buildKernelin classCachedKernel- Parameters:
data- the data to base the kernel on- Throws:
Exception- if something goes wrong
-
globalInfo
Returns a string describing the kernel- Specified by:
globalInfoin classKernel- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
getCapabilities
Returns the Capabilities of this kernel.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Overrides:
getCapabilitiesin classKernel- Returns:
- the capabilities of this object
- See Also:
-
setGamma
@OptionMetadata(description="The value to use for the gamma parameter (default: 0.01).", displayName="gamma", commandLineParamName="G", commandLineParamSynopsis="-G <double>", displayOrder=1) 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
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
toString
returns a string representation for the Kernel -
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classKernel- Returns:
- the revision
-