weka.classifiers.functions.supportVector
Class Kernel

java.lang.Object
  |
  +--weka.classifiers.functions.supportVector.Kernel
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
PolyKernel, RBFKernel

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:
$$
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 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
Returns:
the result of the kernel function
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.


Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London