public class PolyKernel extends CachedKernel
-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). (default: 250007)
-E <num> The Exponent to use. (default: 1.0)
-L Use lower-order terms. (default: no)
Modifier and Type | Field and Description |
---|---|
protected double |
m_exponent
The exponent for the polynomial kernel.
|
protected boolean |
m_lowerOrder
Use lower-order terms?
|
m_cacheHits, m_cacheSize, m_cacheSlots, m_kernelEvals, m_kernelMatrix, m_keys, m_numInsts, m_storage
m_ChecksTurnedOff, m_data, m_Debug
Constructor and Description |
---|
PolyKernel()
default constructor - does nothing.
|
PolyKernel(Instances data,
int cacheSize,
double exponent,
boolean lowerOrder)
Creates a new
PolyKernel instance. |
Modifier and Type | Method and Description |
---|---|
protected double |
evaluate(int id1,
int id2,
Instance inst1)
This method is overridden in subclasses to implement specific kernels.
|
java.lang.String |
exponentTipText()
Returns the tip text for this property
|
double |
getExponent()
Gets the exponent value.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Kernel.
|
boolean |
getUseLowerOrder()
Gets whether lower-order terms are used.
|
java.lang.String |
globalInfo()
Returns a string describing the kernel
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
void |
setExponent(double value)
Sets the exponent value.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setUseLowerOrder(boolean value)
Sets whether to use lower-order terms.
|
java.lang.String |
toString()
returns a string representation for the Kernel
|
java.lang.String |
useLowerOrderTipText()
Returns the tip text for this property
|
buildKernel, cacheSizeTipText, clean, dotProd, eval, getCacheSize, initVars, numCacheHits, numEvals, setCacheSize
checksTurnedOffTipText, debugTipText, forName, getChecksTurnedOff, getDebug, makeCopies, makeCopy, setChecksTurnedOff, setDebug
protected boolean m_lowerOrder
protected double m_exponent
public PolyKernel()
public PolyKernel(Instances data, int cacheSize, double exponent, boolean lowerOrder) throws java.lang.Exception
PolyKernel
instance.data
- the training dataset used.cacheSize
- the size of the cache (a prime number)exponent
- the exponent to uselowerOrder
- whether to use lower-order termsjava.lang.Exception
- if something goes wrongpublic java.lang.String globalInfo()
globalInfo
in class Kernel
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class CachedKernel
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-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). (default: 250007)
-E <num> The Exponent to use. (default: 1.0)
-L Use lower-order terms. (default: no)
setOptions
in interface OptionHandler
setOptions
in class CachedKernel
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class CachedKernel
protected double evaluate(int id1, int id2, Instance inst1) throws java.lang.Exception
CachedKernel
evaluate
in class CachedKernel
id1
- the index of instance 1id2
- the index of instance 2inst1
- the instance 1 objectjava.lang.Exception
- if something goes wrongpublic void setExponent(double value)
value
- the exponent valuepublic double getExponent()
public java.lang.String exponentTipText()
public void setUseLowerOrder(boolean value)
value
- true if lower-order terms will be usedpublic boolean getUseLowerOrder()
public java.lang.String useLowerOrderTipText()
public java.lang.String toString()
toString
in class java.lang.Object