Class SuffixTreeKernel

  • All Implemented Interfaces:
    java.io.Serializable, SVMKernel

    public class SuffixTreeKernel
    extends java.lang.Object
    implements SVMKernel, java.io.Serializable
    Computes the dot-product of two suffix-trees as the sum of the products of the counts of all nodes they have in common.

    This implementation allows you to scale the sub-space for each word length independently.

    Author:
    Matthew Pocock
    See Also:
    Serialized Form
    • Constructor Detail

      • SuffixTreeKernel

        public SuffixTreeKernel()
    • Method Detail

      • setDepthScaler

        public void setDepthScaler​(SuffixTreeKernel.DepthScaler depthScaler)
        Change the current DepthScaler to depthScaler.
        Parameters:
        depthScaler - the new DepthScaler to use
      • evaluate

        public double evaluate​(java.lang.Object a,
                               java.lang.Object b)
        Calculate the dot product between the SuffixTrees a and b.

        This is the sum of the dot products of each subspace for a given word length. Each subspace is scaled using the DepthScaler returned by getDepthScaler.

        Specified by:
        evaluate in interface SVMKernel
        Parameters:
        a - the first Object
        b - the second Object
        Returns:
        a.b
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object