类 CachedKernel

java.lang.Object
weka.classifiers.functions.supportVector.Kernel
weka.classifiers.functions.supportVector.CachedKernel
所有已实现的接口:
Serializable, CapabilitiesHandler, OptionHandler, RevisionHandler
直接已知子类:
PolyKernel, Puk, RBFKernel

public abstract class CachedKernel extends Kernel
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.
版本:
$Revision: 4549 $
作者:
Eibe Frank (eibe@cs.waikato.ac.nz), Shane Legg (shane@intelligenesis.net) (sparse vector code), Stuart Inglis (stuart@reeltwo.com) (sparse vector code), J. Lindgren (jtlindgr{at}cs.helsinki.fi) (RBF kernel), Steven Hugg (hugg@fasterlight.com) (refactored, LRU cache), Bernhard Pfahringer (bernhard@cs.waikato.ac.nz) (full cache)
另请参阅:
  • 构造器详细资料

    • CachedKernel

      public CachedKernel()
      default constructor - does nothing.
  • 方法详细资料

    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      覆盖:
      listOptions 在类中 Kernel
      返回:
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a given list of options.

      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 Kernel
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the Kernel.
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 Kernel
      返回:
      an array of strings suitable for passing to setOptions
    • eval

      public double eval(int id1, int id2, Instance inst1) throws Exception
      Implements the abstract function of Kernel using the cache. This method uses the evaluate() method to do the actual dot product.
      指定者:
      eval 在类中 Kernel
      参数:
      id1 - the index of the first instance in the dataset
      id2 - the index of the second instance in the dataset
      inst1 - the instance corresponding to id1 (used if id1 == -1)
      返回:
      the result of the kernel function
      抛出:
      Exception - if something goes wrong
    • numEvals

      public int numEvals()
      Returns the number of time Eval has been called.
      指定者:
      numEvals 在类中 Kernel
      返回:
      the number of kernel evaluation.
    • numCacheHits

      public int numCacheHits()
      Returns the number of cache hits on dot products.
      指定者:
      numCacheHits 在类中 Kernel
      返回:
      the number of cache hits.
    • clean

      public void clean()
      Frees the cache used by the kernel.
      指定者:
      clean 在类中 Kernel
    • setCacheSize

      public void setCacheSize(int value)
      Sets the size of the cache to use (a prime number)
      参数:
      value - the size of the cache
    • getCacheSize

      public int getCacheSize()
      Gets the size of the cache
      返回:
      the cache size
    • cacheSizeTipText

      public String cacheSizeTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • buildKernel

      public void buildKernel(Instances data) throws Exception
      builds the kernel with the given data. Initializes the kernel cache. The actual size of the cache in bytes is (64 * cacheSize).
      覆盖:
      buildKernel 在类中 Kernel
      参数:
      data - the data to base the kernel on
      抛出:
      Exception - if something goes wrong