public abstract class Kernel extends Object implements Serializable, OptionHandler, CapabilitiesHandler, RevisionHandler
Constructor and Description |
---|
Kernel() |
Modifier and Type | Method and Description |
---|---|
void |
buildKernel(Instances data)
builds the kernel with the given data
|
abstract void |
clean()
Frees the memory used by the kernel.
|
String |
debugTipText()
Returns the tip text for this property
|
abstract double |
eval(int id1,
int id2,
Instance inst1)
Computes the result of the kernel function for two instances.
|
static Kernel |
forName(String kernelName,
String[] options)
Creates a new instance of a kernel given it's class name and (optional)
arguments to pass to it's setOptions method.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this kernel.
|
boolean |
getChecksTurnedOff() |
boolean |
getDebug()
Gets whether debugging output is turned on or not.
|
boolean |
getDoNotCheckCapabilities() |
String[] |
getOptions()
Gets the current settings of the Kernel.
|
String |
getRevision()
Returns the revision string.
|
abstract String |
globalInfo()
Returns a string describing the kernel
|
Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static Kernel[] |
makeCopies(Kernel model,
int num)
Creates a given number of deep or shallow (if the kernel implements
Copyable) copies of the given kernel using serialization.
|
static Kernel |
makeCopy(Kernel kernel)
Creates a shallow copy of the kernel (if it implements Copyable) otherwise
a deep copy using serialization.
|
abstract int |
numCacheHits()
Returns the number of dot product cache hits.
|
abstract int |
numEvals()
Returns the number of kernel evaluation performed.
|
void |
setChecksTurnedOff(boolean value)
These methods remain for backwards compatibility.
|
void |
setDebug(boolean value)
Enables or disables the output of debug information (if the derived kernel
supports that)
|
void |
setDoNotCheckCapabilities(boolean doNotCheckCapabilities)
These methods remain for backwards compatibility.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
makeCopy
@ProgrammaticProperty public void setDoNotCheckCapabilities(boolean doNotCheckCapabilities)
public boolean getDoNotCheckCapabilities()
public abstract String globalInfo()
public abstract double eval(int id1, int id2, Instance inst1) throws Exception
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 abstract void clean()
public abstract int numEvals()
public abstract int numCacheHits()
public Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public void setDebug(boolean value)
value
- whether to output debugging informationpublic boolean getDebug()
public String debugTipText()
@ProgrammaticProperty public void setChecksTurnedOff(boolean value)
public boolean getChecksTurnedOff()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
Capabilities
public String getRevision()
getRevision
in interface RevisionHandler
public void buildKernel(Instances data) throws Exception
data
- the data to base the kernel onException
- if something goes wrongpublic static Kernel makeCopy(Kernel kernel) throws Exception
kernel
- the kernel to copyException
- if an error occurspublic static Kernel[] makeCopies(Kernel model, int num) throws Exception
model
- the kernel to copynum
- the number of kernel copies to create.Exception
- if an error occurspublic static Kernel forName(String kernelName, String[] options) throws Exception
kernelName
- the fully qualified class name of the classifieroptions
- an array of options suitable for passing to setOptions. May
be null.Exception
- if the classifier name is invalid, or the options
supplied are not acceptable to the classifierCopyright © 2020 University of Waikato, Hamilton, NZ. All rights reserved.