Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weka.classifiers.functions.supportVector
Class Kernel

    java.lang.Object
      weka.classifiers.functions.supportVector.Kernel

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  CachedKernel

    public abstract class Kernel

extends java.lang.Object
implements java.io.Serializable

Abstract kernel. Kernels implementing this class must respect Mercer's condition in order to ensure a correct behaviour of SMOreg.

Version:
  $Revision: 1.1.2.2 $
Author:
  Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
  Serialized Form

Constructor Summary
`Kernel()`

Method Summary
`abstract void` | `clean()` Frees the memory used by the kernel.
`abstract double` | `eval(int id1, int id2, Instance inst1)` Computes the result of the kernel function for two instances.
`abstract int` | `numCacheHits()` Returns the number of dot product cache hits.
`abstract int` | `numEvals()` Returns the number of kernel evaluation performed.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Kernel

    public Kernel()

Method Detail

### eval

    public abstract double eval(int id1,
                                int id2,
                                Instance inst1)
                         throws java.lang.Exception

  Computes the result of the kernel function for two instances. If id1 == -1, eval use inst1 instead of an instance in the dataset.

  Parameters:
    `id1` - the index of the first instance in the dataset
    `id2` - the index of the second instance in the dataset
    `inst` - the instance corresponding to id1 (used if id1 == -1)
  Returns:
    the result of the kernel function
  Throws:
    `java.lang.Exception`

### clean

    public abstract void clean()

  Frees the memory used by the kernel. (Usefull 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.

  Returns:
    the number of kernel evaluation performed.

### numCacheHits

    public abstract int numCacheHits()

  Returns the number of dot product cache hits.

  Returns:
    the number of dot product cache hits, or -1 if not supported by this kernel.

Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD