public abstract class CachedKernel extends Kernel
Constructor and Description |
---|
CachedKernel()
default constructor - does nothing.
|
Modifier and Type | Method and Description |
---|---|
void |
buildKernel(Instances data)
builds the kernel with the given data.
|
java.lang.String |
cacheSizeTipText()
Returns the tip text for this property
|
void |
clean()
Frees the cache used by the kernel.
|
double |
eval(int id1,
int id2,
Instance inst1)
Implements the abstract function of Kernel using the cache.
|
int |
getCacheSize()
Gets the size of the cache
|
java.lang.String[] |
getOptions()
Gets the current settings of the Kernel.
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
int |
numCacheHits()
Returns the number of cache hits on dot products.
|
int |
numEvals()
Returns the number of time Eval has been called.
|
void |
setCacheSize(int value)
Sets the size of the cache to use (a prime number)
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
checksTurnedOffTipText, debugTipText, forName, getCapabilities, getChecksTurnedOff, getDebug, getRevision, globalInfo, makeCopies, makeCopy, setChecksTurnedOff, setDebug
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Kernel
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
setOptions
in class Kernel
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 Kernel
public double eval(int id1, int id2, Instance inst1) throws java.lang.Exception
eval
in class Kernel
id1
- the index of the first instance in the datasetid2
- the index of the second instance in the datasetinst1
- the instance corresponding to id1 (used if id1 == -1)java.lang.Exception
- if something goes wrongpublic int numEvals()
public int numCacheHits()
numCacheHits
in class Kernel
public void setCacheSize(int value)
value
- the size of the cachepublic int getCacheSize()
public java.lang.String cacheSizeTipText()
public void buildKernel(Instances data) throws java.lang.Exception
buildKernel
in class Kernel
data
- the data to base the kernel onjava.lang.Exception
- if something goes wrong