smile.math.kernel
Class BinarySparsePolynomialKernel
- java.lang.Object
-
- smile.math.kernel.BinarySparsePolynomialKernel
-
- All Implemented Interfaces:
- java.io.Serializable, MercerKernel<int[]>
public class BinarySparsePolynomialKernel extends java.lang.Object implements MercerKernel<int[]>, java.io.Serializable
The polynomial kernel. 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. The kernel works on sparse binary array as int[], which are the indices of nonzero elements.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BinarySparsePolynomialKernel(int degree)Constructor with scale 1 and bias 0.BinarySparsePolynomialKernel(int degree, double scale, double offset)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublek(int[] x, int[] y)Kernel function.java.lang.StringtoString()
-
-
-
Constructor Detail
-
BinarySparsePolynomialKernel
public BinarySparsePolynomialKernel(int degree)
Constructor with scale 1 and bias 0.
-
BinarySparsePolynomialKernel
public BinarySparsePolynomialKernel(int degree, double scale, double offset)Constructor.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
k
public double k(int[] x, int[] y)Description copied from interface:MercerKernelKernel function.- Specified by:
kin interfaceMercerKernel<int[]>
-
-
DataMelt 3.0 © DataMelt by jWork.ORG