public class Polynomial extends java.lang.Object implements DotProductKernel
k(u, v) = (γ uTv - λ)d
where γ is the scale of the used inner product, λ the offset of
the used inner product, and d the order of the polynomial kernel.| Constructor and Description |
|---|
Polynomial(int degree,
double scale,
double offset,
double[] lo,
double[] hi)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
degree()
Returns the degree of kernel.
|
double |
k(double dot)
Computes the dot product kernel function.
|
double[] |
kg(double dot)
Computes the dot product kernel function and its gradient over hyperparameters..
|
double |
offset()
Returns the offset of kernel.
|
double |
scale()
Returns the scale of kernel.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapply, f, Kpublic Polynomial(int degree,
double scale,
double offset,
double[] lo,
double[] hi)
degree - The degree of polynomial. The degree is fixed during hyperparameter tuning.scale - The scale parameter.offset - The offset parameter.lo - The lower bound of scale and offset for hyperparameter tuning.hi - The upper bound of scale and offset for hyperparameter tuning.public int degree()
public double scale()
public double offset()
public java.lang.String toString()
toString in class java.lang.Objectpublic double k(double dot)
DotProductKernelk in interface DotProductKerneldot - the dot product.public double[] kg(double dot)
DotProductKernelkg in interface DotProductKerneldot - The dot product.