org.knime.base.node.mine.svm.kernel
Interface Kernel

All Known Implementing Classes:
HyperTangentKernel, PolynomialKernel, RBFKernel

public interface Kernel

The kernel interface to be used by any class that wants to implement a kernel.

Author:
Stefan Ciobaca, University of Konstanz, Nicolas Cebron, University of Konstanz

Method Summary
 boolean areValid(double[] params)
          test if the given combination of parameters is valid for this kernel.
 double evaluate(double[] a, double[] b)
          returns the value of the kernel given vectors a and b.
 double evaluate(DoubleVector a, DoubleVector b)
          returns the value of the kernel given vectors a and b.
 double getDefaultParameter(int index)
          return the default parameter at the given index.
 int getNumberParameters()
          Kernel parameters are constants which modify the way the kernel works.
 double getParameter(int index)
          returns the parameter at given index.
 String getParameterName(int index)
          return the name of the parameter at the given index.
 KernelFactory.KernelType getType()
           
 void setParameter(int index, double value)
          sets the given parameter.
 

Method Detail

getType

KernelFactory.KernelType getType()
Returns:
the KernelFactory.KernelType of the Kernel

evaluate

double evaluate(DoubleVector a,
                DoubleVector b)
returns the value of the kernel given vectors a and b.

Parameters:
a - the first vector
b - the second vector
Returns:
the result of the kernel in a and b
See Also:
DoubleVector

evaluate

double evaluate(double[] a,
                double[] b)
returns the value of the kernel given vectors a and b.

Parameters:
a - the first vector
b - the second vector
Returns:
the result of the kernel in a and b

getNumberParameters

int getNumberParameters()
Kernel parameters are constants which modify the way the kernel works. For example, the degree p of the polynomial kernel (x * y + 1) ^ p, is a parameter.

Returns:
the number of kernel parameters

getParameterName

String getParameterName(int index)
return the name of the parameter at the given index. index must be between 0 and getNumberParameters() - 1.

Parameters:
index - the parameter index.
Returns:
the parameter's name (e.g. p or gamma)

areValid

boolean areValid(double[] params)
test if the given combination of parameters is valid for this kernel.

Parameters:
params - the parameters. must have length = getNumberParameters()
Returns:
whether parameter combination is valid or not.

setParameter

void setParameter(int index,
                  double value)
sets the given parameter.

Parameters:
index - the index of the parameter to set
value - the value to put into the parameter

getParameter

double getParameter(int index)
returns the parameter at given index.

Parameters:
index - the index of the parameter to get
Returns:
the value of the parameter

getDefaultParameter

double getDefaultParameter(int index)
return the default parameter at the given index. index must be between 0 and getNumberParameters() - 1.

Parameters:
index - the parameter index.
Returns:
the parameter's default value


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.