Class PrecomputedKernelMatrixKernel
java.lang.Object
weka.classifiers.functions.supportVector.Kernel
weka.classifiers.functions.supportVector.PrecomputedKernelMatrixKernel
- All Implemented Interfaces:
Serializable
,CapabilitiesHandler
,Copyable
,OptionHandler
,RevisionHandler
This kernel is based on a static kernel matrix that
is read from a file. Instances must have a single nominal attribute
(excluding the class). This attribute must be the first attribute in the file
and its values are used to reference rows/columns in the kernel matrix. The
second attribute must be the class attribute.
Valid options are:
-D Enables debugging output (if available) to be printed. (default: off)
-M <file name> The file name of the file that holds the kernel matrix. (default: kernelMatrix.matrix)
- Version:
- $Revision: 14512 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clean()
Frees the memory used by the kernel.copy()
Return a shallow copy of this kerneldouble
Computes the result of the kernel function for two instances.Returns the Capabilities of this kernel.Gets the file containing the kernel matrix.String[]
Gets the current settings of the Kernel.Returns the revision string.Returns a string describing the kernelReturns the tip text for this propertyReturns an enumeration describing the available options.int
Returns the number of dot product cache hits.int
numEvals()
Returns the number of kernel evaluation performed.void
Sets the file holding the kernel matrixvoid
setOptions
(String[] options) Parses a given list of options.toString()
returns a string representation for the KernelMethods inherited from class weka.classifiers.functions.supportVector.Kernel
buildKernel, debugTipText, forName, getChecksTurnedOff, getDebug, getDoNotCheckCapabilities, makeCopies, makeCopy, setChecksTurnedOff, setDebug, setDoNotCheckCapabilities
-
Constructor Details
-
PrecomputedKernelMatrixKernel
public PrecomputedKernelMatrixKernel()
-
-
Method Details
-
copy
Return a shallow copy of this kernel -
globalInfo
Returns a string describing the kernel- Specified by:
globalInfo
in classKernel
- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Overrides:
listOptions
in classKernel
- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-D Enables debugging output (if available) to be printed. (default: off)
-M <file name> The file name of the file that holds the kernel matrix. (default: kernelMatrix.matrix)
- Specified by:
setOptions
in interfaceOptionHandler
- Overrides:
setOptions
in classKernel
- Parameters:
options
- the list of options as an array of strings- Throws:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Kernel.- Specified by:
getOptions
in interfaceOptionHandler
- Overrides:
getOptions
in classKernel
- Returns:
- an array of strings suitable for passing to setOptions
-
eval
Description copied from class:Kernel
Computes the result of the kernel function for two instances. If id1 == -1, eval use inst1 instead of an instance in the dataset. -
getCapabilities
Returns the Capabilities of this kernel.- Specified by:
getCapabilities
in interfaceCapabilitiesHandler
- Overrides:
getCapabilities
in classKernel
- Returns:
- the capabilities of this object
- See Also:
-
setKernelMatrixFile
Sets the file holding the kernel matrix- Parameters:
f
- the file holding the matrix
-
getKernelMatrixFile
Gets the file containing the kernel matrix.- Returns:
- the exponent value
-
kernelMatrixFileTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
toString
returns a string representation for the Kernel -
clean
public void clean()Frees the memory used by the kernel. (Useful with kernels which use cache.) This function is called when the training is done. i.e. after that, eval will be called with id1 == -1. -
numEvals
public int numEvals()Returns the number of kernel evaluation performed. -
numCacheHits
public int numCacheHits()Returns the number of dot product cache hits.- Specified by:
numCacheHits
in classKernel
- Returns:
- the number of dot product cache hits, or -1 if not supported by this kernel.
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classKernel
- Returns:
- the revision
-