|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.functions.supportVector.Kernel
weka.classifiers.functions.supportVector.CachedKernel
public abstract class CachedKernel
Base class for RBFKernel and PolyKernel that implements a simple LRU. (least-recently-used) cache if the cache size is set to a value > 0. Otherwise it uses a full cache.
Constructor Summary | |
---|---|
CachedKernel()
default constructor - does nothing. |
Method Summary | |
---|---|
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. |
Methods inherited from class weka.classifiers.functions.supportVector.Kernel |
---|
checksTurnedOffTipText, debugTipText, forName, getCapabilities, getChecksTurnedOff, getDebug, globalInfo, makeCopies, makeCopy, setChecksTurnedOff, setDebug |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface weka.core.RevisionHandler |
---|
getRevision |
Constructor Detail |
---|
public CachedKernel()
Method Detail |
---|
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 strings
java.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()
numEvals
in class Kernel
public int numCacheHits()
numCacheHits
in class Kernel
public void clean()
clean
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 on
java.lang.Exception
- if something goes wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |