Class Polynomial
java.lang.Object
org.tribuo.math.kernel.Polynomial
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>,Serializable,Kernel,ProtoSerializable<org.tribuo.math.protos.KernelProto>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intProtobuf serialization version.Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER -
Constructor Summary
ConstructorsConstructorDescriptionPolynomial(double gamma, double intercept, double degree) A polynomial kernel, (gamma*u.dot(v) + intercept)^degree. -
Method Summary
Modifier and TypeMethodDescriptionstatic PolynomialdeserializeFromProto(int version, String className, com.google.protobuf.Any message) Deserialization factory.booleancom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenanceinthashCode()org.tribuo.math.protos.KernelProtoSerializes this object to a protobuf.doubleCalculates the similarity between twoSparseVectors.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSIONProtobuf serialization version.- See Also:
-
-
Constructor Details
-
Polynomial
public Polynomial(double gamma, double intercept, double degree) A polynomial kernel, (gamma*u.dot(v) + intercept)^degree.- Parameters:
gamma- The scalar coefficient.intercept- An additive coefficient.degree- The degree of the polynomial.
-
-
Method Details
-
deserializeFromProto
public static Polynomial deserializeFromProto(int version, String className, com.google.protobuf.Any message) throws com.google.protobuf.InvalidProtocolBufferException Deserialization factory.- Parameters:
version- The serialized object version.className- The class name.message- The serialized data.- Returns:
- The deserialized object.
- Throws:
com.google.protobuf.InvalidProtocolBufferException- If the protobuf could not be parsed from themessage.
-
serialize
public org.tribuo.math.protos.KernelProto serialize()Description copied from interface:ProtoSerializableSerializes this object to a protobuf.- Specified by:
serializein interfaceProtoSerializable<org.tribuo.math.protos.KernelProto>- Returns:
- The protobuf.
-
similarity
Description copied from interface:KernelCalculates the similarity between twoSparseVectors.- Specified by:
similarityin interfaceKernel- Parameters:
a- The first SparseVector.b- The second SparseVector.- Returns:
- A value between 0 and 1, where 1 is most similar and 0 is least similar.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-
equals
-
hashCode
-