com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel
Class Kernel

java.lang.Object
  extended by com.rapidminer.operator.learner.functions.kernel.jmysvm.kernel.Kernel
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
KernelAnova, KernelDot, KernelEpanechnikov, KernelGaussianCombination, KernelMultiquadric, KernelNeural, KernelPolynomial, KernelRadial

public abstract class Kernel
extends java.lang.Object
implements java.io.Serializable

Abstract base class for all kernels.

Author:
Stefan Rueping, Ingo Mierswa
See Also:
Serialized Form

Field Summary
protected  int cache_MB
          Size of cache in MB
protected  int dim
          dimension of the examples
protected  int examples_total
          number of examples after shrinking
protected  Cache kernel_cache
          Kernel cache
protected  int kernel_cache_size
          Number of elements in cache
protected  SVMExamples the_examples
          Container for the examples, parameters etc.
 
Constructor Summary
Kernel()
          Class constructor
 
Method Summary
 double[] calculate_K_row(double[] result, int i)
           
abstract  double calculate_K(int[] x_index, double[] x_att, int[] y_index, double[] y_att)
          Calculates kernel value of vectors x and y
 double calculate_K(int i, int j)
          Calculate K(i,j)
 double calculate_K(SVMExample x, SVMExample y)
           
 double[] get_row(int i)
          Gets a kernel row
 int getCacheSize()
           
abstract  java.lang.String getDistanceFormula(double[] x, java.lang.String[] attributeNames)
           
 void init_kernel_cache(int size)
          Inits the kernel cache.
 void init(SVMExamples examples, int cacheSizeMB)
          Init the kernel
 double innerproduct(int[] x_index, double[] x_att, int[] y_index, double[] y_att)
          calculate inner product
 double norm2(int[] x_index, double[] x_att, int[] y_index, double[] y_att)
          calculate ||x-y||^2
 void set_examples_size(int new_examples_total)
          Sets the number of examples to new value
 void swap(int pos1, int pos2)
          swap two training examples
 java.lang.String toString()
          Output as String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

the_examples

protected SVMExamples the_examples
Container for the examples, parameters etc.


dim

protected int dim
dimension of the examples


kernel_cache

protected transient Cache kernel_cache
Kernel cache


kernel_cache_size

protected int kernel_cache_size
Number of elements in cache


cache_MB

protected int cache_MB
Size of cache in MB


examples_total

protected int examples_total
number of examples after shrinking

Constructor Detail

Kernel

public Kernel()
Class constructor

Method Detail

toString

public java.lang.String toString()
Output as String

Overrides:
toString in class java.lang.Object

init

public void init(SVMExamples examples,
                 int cacheSizeMB)
Init the kernel

Parameters:
examples - Container for the examples.

calculate_K

public abstract double calculate_K(int[] x_index,
                                   double[] x_att,
                                   int[] y_index,
                                   double[] y_att)
Calculates kernel value of vectors x and y


getDistanceFormula

public abstract java.lang.String getDistanceFormula(double[] x,
                                                    java.lang.String[] attributeNames)

innerproduct

public double innerproduct(int[] x_index,
                           double[] x_att,
                           int[] y_index,
                           double[] y_att)
calculate inner product


norm2

public double norm2(int[] x_index,
                    double[] x_att,
                    int[] y_index,
                    double[] y_att)
calculate ||x-y||^2


get_row

public double[] get_row(int i)
Gets a kernel row


init_kernel_cache

public void init_kernel_cache(int size)
Inits the kernel cache.

Parameters:
size - of the cache in MB

getCacheSize

public int getCacheSize()

set_examples_size

public void set_examples_size(int new_examples_total)
Sets the number of examples to new value


calculate_K

public double calculate_K(int i,
                          int j)
Calculate K(i,j)


calculate_K

public double calculate_K(SVMExample x,
                          SVMExample y)

calculate_K_row

public double[] calculate_K_row(double[] result,
                                int i)

swap

public void swap(int pos1,
                 int pos2)
swap two training examples

Parameters:
pos1 -
pos2 -


Copyright © 2001-2009 by Rapid-I