Interface Kernel

All Superinterfaces:, ProtoSerializable<org.tribuo.math.protos.KernelProto>,<>, Serializable
All Known Implementing Classes:
Linear, Polynomial, RBF, Sigmoid

public interface Kernel extends, ProtoSerializable<org.tribuo.math.protos.KernelProto>,<>, Serializable
An interface for a Mercer kernel function.

It's preferable for kernels to override toString.

  • Method Details

    • similarity

      double similarity(SparseVector first, SparseVector second)
      Calculates the similarity between two SparseVectors.
      first - The first SparseVector.
      second - The second SparseVector.
      A value between 0 and 1, where 1 is most similar and 0 is least similar.
    • deserialize

      static Kernel deserialize(org.tribuo.math.protos.KernelProto proto)
      Deserializes the kernel from the supplied protobuf.
      proto - The protobuf to deserialize.
      The kernel.