public class RBFKernel 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)
-G <num> The Gamma parameter. (default: 0.01)
Modifier and Type | Field and Description |
---|---|
protected double |
m_gamma
Gamma for the RBF kernel.
|
protected double[] |
m_kernelPrecalc
The precalculated dotproducts of <inst_i,inst_i>
|
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 |
---|
RBFKernel()
default constructor - does nothing.
|
RBFKernel(Instances data,
int cacheSize,
double gamma)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
buildKernel(Instances data)
builds the kernel with the given data.
|
protected double |
evaluate(int id1,
int id2,
Instance inst1)
This method is overridden in subclasses to implement specific kernels.
|
java.lang.String |
gammaTipText()
Returns the tip text for this property
|
double |
getGamma()
Gets the gamma value.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Kernel.
|
java.lang.String |
globalInfo()
Returns a string describing the kernel
|
protected void |
initVars(Instances data)
initializes variables etc.
|
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
|
cacheSizeTipText, clean, dotProd, eval, getCacheSize, numCacheHits, numEvals, setCacheSize
checksTurnedOffTipText, debugTipText, forName, getChecksTurnedOff, getDebug, makeCopies, makeCopy, setChecksTurnedOff, setDebug
protected double[] m_kernelPrecalc
protected double m_gamma
public RBFKernel()
public RBFKernel(Instances data, int cacheSize, double gamma) throws java.lang.Exception
data
- the data to usecacheSize
- the size of the cachegamma
- the bandwidthjava.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)
-G <num> The Gamma parameter. (default: 0.01)
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 setGamma(double value)
value
- the gamma valuepublic double getGamma()
public java.lang.String gammaTipText()
protected void initVars(Instances data)
initVars
in class CachedKernel
data
- the data to usepublic void buildKernel(Instances data) throws java.lang.Exception
buildKernel
in class CachedKernel
data
- the data to base the kernel onjava.lang.Exception
- if something goes wrongpublic java.lang.String toString()
toString
in class java.lang.Object