Package org.tribuo.math.kernel
Interface Kernel
- All Superinterfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,ProtoSerializable<org.tribuo.math.protos.KernelProto>
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,Serializable
- All Known Implementing Classes:
Linear
,Polynomial
,RBF
,Sigmoid
public interface Kernel
extends com.oracle.labs.mlrg.olcut.config.Configurable, ProtoSerializable<org.tribuo.math.protos.KernelProto>, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, Serializable
An interface for a Mercer kernel function.
It's preferable for kernels to override toString.
-
Field Summary
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Method Summary
Modifier and TypeMethodDescriptionstatic Kernel
deserialize
(org.tribuo.math.protos.KernelProto proto) Deserializes the kernel from the supplied protobuf.double
similarity
(SparseVector first, SparseVector second) Calculates the similarity between twoSparseVector
s.Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize
Methods inherited from interface com.oracle.labs.mlrg.olcut.provenance.Provenancable
getProvenance
-
Method Details
-
similarity
Calculates the similarity between twoSparseVector
s.- Parameters:
first
- The first SparseVector.second
- The second SparseVector.- Returns:
- A value between 0 and 1, where 1 is most similar and 0 is least similar.
-
deserialize
Deserializes the kernel from the supplied protobuf.- Parameters:
proto
- The protobuf to deserialize.- Returns:
- The kernel.
-