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.
|
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
|
String[] |
getOptions()
Gets the current settings of the Kernel.
|
Enumeration<Option> |
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(String[] options)
Parses a given list of options.
|
debugTipText, forName, getCapabilities, getChecksTurnedOff, getDebug, getDoNotCheckCapabilities, getRevision, globalInfo, makeCopies, makeCopy, setChecksTurnedOff, setDebug, setDoNotCheckCapabilities
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
makeCopy
public Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class Kernel
public void setOptions(String[] options) throws Exception
setOptions
in interface OptionHandler
setOptions
in class Kernel
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Kernel
public double eval(int id1, int id2, Instance inst1) throws 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)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 String cacheSizeTipText()
public void buildKernel(Instances data) throws Exception
buildKernel
in class Kernel
data
- the data to base the kernel onException
- if something goes wrongCopyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.