weka.classifiers.functions.supportVector
Class PolyKernel

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

public class PolyKernel
extends Kernel

The polynomial kernel : K(x, y) = ^p or K(x, y) = (+1)^p

Version:
$$
Author:
Eibe Frank (eibe@cs.waikato.ac.nz), Shane Legg (shane@intelligenesis.net) (sparse vector code), Stuart Inglis (stuart@reeltwo.com) (sparse vector code)
See Also:
Serialized Form

Constructor Summary
PolyKernel(Instances dataset, int cacheSize, double exponent, boolean lowerOrder)
          Creates a new PolyKernel instance.
 
Method Summary
 void clean()
          Frees the cache used by the kernel.
 double eval(int id1, int id2, Instance inst1)
          Implements the abstract function of Kernel.
 int numEvals()
          Returns the number of time Eval has been called.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolyKernel

public PolyKernel(Instances dataset,
                  int cacheSize,
                  double exponent,
                  boolean lowerOrder)
Creates a new PolyKernel instance.

Parameters:
dataset - the training dataset used.
cacheSize - the size of the cache (a prime number)
Method Detail

eval

public double eval(int id1,
                   int id2,
                   Instance inst1)
            throws java.lang.Exception
Implements the abstract function of Kernel.

Specified by:
eval in class Kernel
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 void clean()
Frees the cache used by the kernel.

Specified by:
clean in class Kernel

numEvals

public int numEvals()
Returns the number of time Eval has been called.

Specified by:
numEvals in class Kernel
Returns:
the number of kernel evaluation.


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