public class PDRFKernel extends CachedKernel
Modifier and Type | Field and Description |
---|---|
static int |
Cauchy
Type of Positive Definite Functions supported (Cauchy)
|
static int |
Gaussian
Type of Positive Definite Functions supported (Gaussian)
|
static int |
HyperbolicSecant
Type of Positive Definite Functions supported (Hyperbolic secant)
|
static int |
Laplace
Type of Positive Definite Functions supported (Laplace)
|
protected double |
m_d
The d value for the PDRF kernel.
|
protected double[] |
m_kernelPrecalc
The precalculated dotproducts of <inst_i,inst_i>
|
protected int |
m_type
The type of function used by this kernel
|
static int |
SquaredSinc
Type of Positive Definite Functions supported (Squared sinc)
|
static int |
SymmetricTriangle
Type of Positive Definite Functions supported (Symmetric Triangle)
|
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 |
---|
PDRFKernel()
default constructor - does nothing.
|
PDRFKernel(Instances data,
int cacheSize,
double gamma)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
cauchy(double x)
Computes the result of the Cauchy PDRF
|
java.lang.String |
dTipText()
Returns the tip text for this property
|
protected double |
evaluate(int id1,
int id2,
Instance inst1)
This method is overridden in subclasses to implement specific kernels.
|
double |
evaluatePRDF(double[] u)
Evaluates a vector of doubles (an instance) with the
Positive Definite Functions associated
|
double |
gaussian(double x)
Computes the result of the Gaussian PDRF
|
double |
getD()
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
|
double |
hyperbolicSecant(double x)
Computes the result of the Hyperbolic Secant PDRF
|
protected void |
initVars(Instances data)
initializes variables etc.
|
double |
laplace(double x)
Computes the result of the Laplace PDRF
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
void |
setD(double value)
Sets the gamma value.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setPDRFType(int type)
Sets the Type of Positive Definite Functions used.
|
double |
squaredSinc(double x)
Computes the result of the Squared Sinc PDRF
|
double |
symmetricTriangle(double x)
Computes the result of the Symmetric Triangle PDRF
|
java.lang.String |
toString()
returns a string representation for the Kernel
|
buildKernel, cacheSizeTipText, clean, dotProd, eval, getCacheSize, numCacheHits, numEvals, setCacheSize
checksTurnedOffTipText, debugTipText, forName, getChecksTurnedOff, getDebug, makeCopies, makeCopy, setChecksTurnedOff, setDebug
public static int SymmetricTriangle
public static int Gaussian
public static int Cauchy
public static int Laplace
public static int HyperbolicSecant
public static int SquaredSinc
protected double[] m_kernelPrecalc
protected double m_d
protected int m_type
public PDRFKernel()
public PDRFKernel(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 setD(double value)
value
- the gamma valuepublic double getD()
public void setPDRFType(int type)
type
- integer that indentify the function used.public java.lang.String dTipText()
protected void initVars(Instances data)
initVars
in class CachedKernel
data
- the data to usepublic java.lang.String toString()
toString
in class java.lang.Object
public double evaluatePRDF(double[] u)
u
- The instance to be evaluatedpublic double symmetricTriangle(double x)
x
- The input of this function (x-z)public double gaussian(double x)
x
- The input of this function (x-z)public double cauchy(double x)
x
- The input of this function (x-z)public double laplace(double x)
x
- The input of this function (x-z)public double hyperbolicSecant(double x)
x
- The input of this function (x-z)public double squaredSinc(double x)
x
- The input of this function (x-z)