Class SparseVector.NormalizingKernel

java.lang.Object
org.biojava.stats.svm.SparseVector.NormalizingKernel
All Implemented Interfaces:
Serializable, SVMKernel
Enclosing class:
SparseVector

public static class SparseVector.NormalizingKernel extends Object implements SVMKernel, Serializable
A version of the standard dot-product kernel that scales each column independently.
Author:
Matthew Pocock
See Also:
  • Constructor Details

    • NormalizingKernel

      Generate a normalizing kernel with the normalizing vector s.
      Parameters:
      s - the SparseVector to normalize by
    • NormalizingKernel

      public NormalizingKernel(List vectors)
      Generate a normalizing kernel defined by the SparseVectors in vectors.

      It will set up a normalizing vector that has weight that will scale each element so that the average score is 1.

  • Method Details

    • getNormalizingVector

      Retrive the current normalizing vector.
      Returns:
      the normalizing vector
    • setNormalizingVector

      Set the normalizing vector.
      Parameters:
      nv - the new normalizing vector
    • evaluate

      public double evaluate(Object o1, Object o2)
      Evaluate the kernel function between two SparseVectors.

      This function is equivalent to:
      k(a, b) = sum_i ( a_i * b_i * nv_i )
      where nv_i is the value of the normalizing vector at index i. This can be thought of as scaling each vector at index i by sqrt(nv_i).

      Specified by:
      evaluate in interface SVMKernel
    • toString

      public String toString()
      Overrides:
      toString in class Object