类 Kernel
java.lang.Object
weka.classifiers.functions.supportVector.Kernel
- 所有已实现的接口:
Serializable
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
public abstract class Kernel
extends Object
implements Serializable, OptionHandler, CapabilitiesHandler, RevisionHandler
Abstract kernel.
Kernels implementing this class must respect Mercer's condition in order
to ensure a correct behaviour of SMOreg.
- 版本:
- $Revision: 9897 $
- 作者:
- Eibe Frank (eibe@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildKernel
(Instances data) builds the kernel with the given dataReturns the tip text for this propertyabstract void
clean()
Frees the memory used by the kernel.Returns the tip text for this propertyabstract double
Computes the result of the kernel function for two instances.static Kernel
Creates a new instance of a kernel given it's class name and (optional) arguments to pass to it's setOptions method.Returns the Capabilities of this kernel.boolean
Returns whether the checks are turned off or not.boolean
getDebug()
Gets whether debugging output is turned on or not.String[]
Gets the current settings of the Kernel.Returns the revision string.abstract String
Returns a string describing the kernelReturns 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
Creates a shallow copy of the kernel (if it implements Copyable) otherwise a deep copy using serialization.abstract int
Returns the number of dot product cache hits.abstract int
numEvals()
Returns the number of kernel evaluation performed.void
setChecksTurnedOff
(boolean value) Disables or enables the checks (which could be time-consuming).void
setDebug
(boolean value) Enables or disables the output of debug information (if the derived kernel supports that)void
setOptions
(String[] options) Parses a given list of options.
-
构造器详细资料
-
Kernel
public Kernel()
-
-
方法详细资料
-
globalInfo
Returns a string describing the kernel- 返回:
- a description suitable for displaying in the explorer/experimenter gui
-
eval
Computes the result of the kernel function for two instances. If id1 == -1, eval use inst1 instead of an instance in the dataset.- 参数:
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)- 返回:
- the result of the kernel function
- 抛出:
Exception
- if something goes wrong
-
clean
public abstract 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 abstract int numEvals()Returns the number of kernel evaluation performed.- 返回:
- the number of kernel evaluation performed.
-
numCacheHits
public abstract int numCacheHits()Returns the number of dot product cache hits.- 返回:
- the number of dot product cache hits, or -1 if not supported by this kernel.
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options.- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Kernel.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions
-
setDebug
public void setDebug(boolean value) Enables or disables the output of debug information (if the derived kernel supports that)- 参数:
value
- whether to output debugging information
-
getDebug
public boolean getDebug()Gets whether debugging output is turned on or not.- 返回:
- true if debugging output is produced.
-
debugTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setChecksTurnedOff
public void setChecksTurnedOff(boolean value) Disables or enables the checks (which could be time-consuming). Use with caution!- 参数:
value
- if true turns off all checks
-
getChecksTurnedOff
public boolean getChecksTurnedOff()Returns whether the checks are turned off or not.- 返回:
- true if the checks are turned off
-
checksTurnedOffTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getCapabilities
Returns the Capabilities of this kernel. Derived kernels have to override this method to enable capabilities.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 返回:
- the capabilities of this object
- 另请参阅:
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
buildKernel
builds the kernel with the given data- 参数:
data
- the data to base the kernel on- 抛出:
Exception
- if something goes wrong
-
makeCopy
Creates a shallow copy of the kernel (if it implements Copyable) otherwise a deep copy using serialization.- 参数:
kernel
- the kernel to copy- 返回:
- a shallow or deep copy of the kernel
- 抛出:
Exception
- if an error occurs
-
makeCopies
Creates a given number of deep or shallow (if the kernel implements Copyable) copies of the given kernel using serialization.- 参数:
model
- the kernel to copynum
- the number of kernel copies to create.- 返回:
- an array of kernels.
- 抛出:
Exception
- if an error occurs
-
forName
Creates a new instance of a kernel given it's class name and (optional) arguments to pass to it's setOptions method.- 参数:
kernelName
- the fully qualified class name of the classifieroptions
- an array of options suitable for passing to setOptions. May be null.- 返回:
- the newly created classifier, ready for use.
- 抛出:
Exception
- if the classifier name is invalid, or the options supplied are not acceptable to the classifier
-