Class NormalizedPolyKernel
- java.lang.Object
-
- weka.classifiers.functions.supportVector.Kernel
-
- weka.classifiers.functions.supportVector.CachedKernel
-
- weka.classifiers.functions.supportVector.PolyKernel
-
- weka.classifiers.functions.supportVector.NormalizedPolyKernel
-
- All Implemented Interfaces:
Serializable,CapabilitiesHandler,OptionHandler,RevisionHandler
public class NormalizedPolyKernel extends PolyKernel
The normalized polynomial kernel.
K(x,y) = <x,y>/sqrt(<x,x><y,y>) where <x,y> = PolyKernel(x,y) Valid options are:-D Enables debugging output (if available) to be printed. (default: off)
-C <num> The size of the cache (a prime number), 0 for full cache and -1 to turn it off. (default: 250007)
-E <num> The Exponent to use. (default: 1.0)
-L Use lower-order terms. (default: no)
- Version:
- $Revision$
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NormalizedPolyKernel()default constructor - does nothingNormalizedPolyKernel(Instances dataset, int cacheSize, double exponent, boolean lowerOrder)Creates a newNormalizedPolyKernelinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildKernel(Instances data)builds the kernel with the given data.voidclean()Frees the cache used by the kernel.StringgetRevision()Returns the revision string.StringglobalInfo()Returns a string describing the kernelStringtoString()returns a string representation for the Kernel-
Methods inherited from class weka.classifiers.functions.supportVector.PolyKernel
exponentTipText, getCapabilities, getExponent, getOptions, getUseLowerOrder, listOptions, setExponent, setOptions, setUseLowerOrder, useLowerOrderTipText
-
Methods inherited from class weka.classifiers.functions.supportVector.CachedKernel
cacheSizeTipText, eval, getCacheSize, numCacheHits, numEvals, setCacheSize
-
Methods inherited from class weka.classifiers.functions.supportVector.Kernel
debugTipText, forName, getChecksTurnedOff, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, setChecksTurnedOff, setDebug, setDoNotCheckCapabilities
-
-
-
-
Constructor Detail
-
NormalizedPolyKernel
public NormalizedPolyKernel()
default constructor - does nothing
-
NormalizedPolyKernel
public NormalizedPolyKernel(Instances dataset, int cacheSize, double exponent, boolean lowerOrder) throws Exception
Creates a newNormalizedPolyKernelinstance.- Parameters:
dataset- the training dataset used.cacheSize- the size of the cache (a prime number)exponent- the exponent to uselowerOrder- whether to use lower-order terms- Throws:
Exception- if something goes wrong
-
-
Method Detail
-
buildKernel
public void buildKernel(Instances data) throws Exception
builds the kernel with the given data. Initializes the kernel cache. The actual size of the cache in bytes is (64 * cacheSize).- Overrides:
buildKernelin classCachedKernel- Parameters:
data- the data to base the kernel on- Throws:
Exception- if something goes wrong
-
clean
public void clean()
Frees the cache used by the kernel.- Overrides:
cleanin classCachedKernel
-
globalInfo
public String globalInfo()
Returns a string describing the kernel- Overrides:
globalInfoin classPolyKernel- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
toString
public String toString()
returns a string representation for the Kernel- Overrides:
toStringin classPolyKernel- Returns:
- a string representaiton of the kernel
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classPolyKernel- Returns:
- the revision
-
-