weka.classifiers.functions.supportVector
Class Kernel

java.lang.Object
  extended byweka.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

Field Summary
(package private)  Instances m_data
          The dataset
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_data

Instances m_data
The dataset

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
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.