NormalizedPolyKernel (original) (raw)
java.lang.Object
- weka.classifiers.functions.supportVector.Kernel
- weka.classifiers.functions.supportVector.CachedKernel
- weka.classifiers.functions.supportVector.PolyKernel
* * weka.classifiers.functions.supportVector.NormalizedPolyKernel
- weka.classifiers.functions.supportVector.PolyKernel
- weka.classifiers.functions.supportVector.CachedKernel
All Implemented Interfaces:
java.io.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)
-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)
-E
The Exponent to use.
(default: 1.0)
-L
Use lower-order terms.
(default: no)
Version: Revision:1.8Revision: 1.8 Revision:1.8
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form
Constructor Summary
Constructors
Constructor and Description NormalizedPolyKernel() default constructor - does nothing NormalizedPolyKernel(Instances dataset, int cacheSize, double exponent, boolean lowerOrder) Creates a new NormalizedPolyKernel instance. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description double eval(int id1, int id2,Instance inst1) Computes the result of the kernel function for two instances. java.lang.String getRevision() Returns the revision string. java.lang.String globalInfo() Returns a string describing the kernel void setExponent(double value) Sets the exponent value (must be different from 1.0). java.lang.String toString() returns a string representation for the Kernel * ### Methods inherited from class weka.classifiers.functions.supportVector.[PolyKernel](../../../../weka/classifiers/functions/supportVector/PolyKernel.html "class in weka.classifiers.functions.supportVector") `[clean](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#clean--), [exponentTipText](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#exponentTipText--), [getCapabilities](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#getCapabilities--), [getExponent](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#getExponent--), [getOptions](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#getOptions--), [getUseLowerOrder](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#getUseLowerOrder--), [listOptions](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#listOptions--), [setOptions](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#setOptions-java.lang.String:A-), [setUseLowerOrder](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#setUseLowerOrder-boolean-), [useLowerOrderTipText](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#useLowerOrderTipText--)` * ### Methods inherited from class weka.classifiers.functions.supportVector.[CachedKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html "class in weka.classifiers.functions.supportVector") `[buildKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#buildKernel-weka.core.Instances-), [cacheSizeTipText](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#cacheSizeTipText--), [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
* #### NormalizedPolyKernel public NormalizedPolyKernel() default constructor - does nothing * #### NormalizedPolyKernel public NormalizedPolyKernel([Instances](../../../../weka/core/Instances.html "class in weka.core") dataset, int cacheSize, double exponent, boolean lowerOrder) throws java.lang.Exception Creates a new `NormalizedPolyKernel` instance. Parameters: `dataset` \- the training dataset used. `cacheSize` \- the size of the cache (a prime number) `exponent` \- the exponent to use `lowerOrder` \- whether to use lower-order terms Throws: `java.lang.Exception` \- if something goes wrong
Method Detail
* #### globalInfo public java.lang.String globalInfo() Returns a string describing the kernel Overrides: `[globalInfo](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#globalInfo--)` in class `[PolyKernel](../../../../weka/classifiers/functions/supportVector/PolyKernel.html "class in weka.classifiers.functions.supportVector")` Returns: a description suitable for displaying in the explorer/experimenter gui * #### eval public double eval(int id1, int id2, [Instance](../../../../weka/core/Instance.html "class in weka.core") inst1) throws java.lang.Exception Computes the result of the kernel function for two instances. If id1 == -1, eval use inst1 instead of an instance in the dataset. Redefines the eval function of PolyKernel. Overrides: `[eval](../../../../weka/classifiers/functions/supportVector/CachedKernel.html#eval-int-int-weka.core.Instance-)` in class `[CachedKernel](../../../../weka/classifiers/functions/supportVector/CachedKernel.html "class in weka.classifiers.functions.supportVector")` Parameters: `id1` \- the index of the first instance in the dataset `id2` \- the index of the second instance in the dataset `inst1` \- the instance corresponding to id1 (used if id1 == -1) Returns: the result of the kernel function Throws: `java.lang.Exception` \- if something goes wrong * #### setExponent public void setExponent(double value) Sets the exponent value (must be different from 1.0). Overrides: `[setExponent](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#setExponent-double-)` in class `[PolyKernel](../../../../weka/classifiers/functions/supportVector/PolyKernel.html "class in weka.classifiers.functions.supportVector")` Parameters: `value` \- the exponent value * #### toString public java.lang.String toString() returns a string representation for the Kernel Overrides: `[toString](../../../../weka/classifiers/functions/supportVector/PolyKernel.html#toString--)` in class `[PolyKernel](../../../../weka/classifiers/functions/supportVector/PolyKernel.html "class in weka.classifiers.functions.supportVector")` 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/PolyKernel.html#getRevision--)` in class `[PolyKernel](../../../../weka/classifiers/functions/supportVector/PolyKernel.html "class in weka.classifiers.functions.supportVector")` Returns: the revision