Package org.tribuo.math.kernel
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
A polynomial kernel, (gamma*u.dot(v) + intercept)^degree.
- See Also:
-
Constructor Summary
ConstructorDescriptionPolynomial
(double gamma, double intercept, double degree) A polynomial kernel, (gamma*u.dot(v) + intercept)^degree. -
Method Summary
Modifier and TypeMethodDescriptioncom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
double
Calculates the similarity between twoSparseVector
s.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
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
-
similarity
Description copied from interface:Kernel
Calculates the similarity between twoSparseVector
s.- Specified by:
similarity
in 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:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-