public class PolynomialKernel extends Object implements KernelFunction, Serializable
PolynomialKernel provides a dot product over a fixed
degree polynomial basis expansion of a vector.
The polynomial kernel of degree d over vectors
v1 and v2 is defined in terms of
underlying vector dot products:
wherekernel(v1,v2) = (1 + v1 * v2)d
v1 * v2 is shorthand for the method call
v1.dotProduct(v2).
A polynomial kernel may be serialized.
A thorough discussion of kernel functions and kernel-based classifiers may be found in:
| Constructor and Description |
|---|
PolynomialKernel(int degree)
Construct a polynomial kernel function of the specified degree.
|
| Modifier and Type | Method and Description |
|---|---|
double |
proximity(Vector v1,
Vector v2)
Returns the result of applying the polynomial kernel of
this class's degree to the specified vectors.
|
String |
toString()
Returns a string-based representation of this kernel
function, including the kernel type and degree.
|
public PolynomialKernel(int degree)
degree - Degree of the polynomial kernel.public double proximity(Vector v1, Vector v2)
proximity in interface KernelFunctionproximity in interface Proximity<Vector>v1 - First vector.v2 - Second vector.IllegalArgumentException - If the vectors are not of the
same dimensionality.Copyright © 2016 Alias-i, Inc.. All rights reserved.