PolynomialKernel

class rlscore.kernel.polynomial_kernel.PolynomialKernel(X, degree=2, gamma=1.0, coef0=0)

Bases: object

Polynomial kernel.

k(xi,xj) = (gamma * <xi, xj> + coef0)**degree

Parameters:
X : {array-like, sparse matrix}, shape = [n_bvectors, n_features]

Basis vectors

gamma : float, optional (default 1.0)

Kernel parameter

coef0 : float, optional (default 0.)

Kernel parameter

degree : int, optional (default 2)

Kernel parameter

Attributes:
X : {array-like, sparse matrix}, shape = [n_bvectors, n_features]

Basis vectors

gamma : float

Kernel parameter

coef0 : float

Kernel parameter

degree : int

Kernel parameter

getKM(X)

Returns the kernel matrix between the basis vectors and X.

Parameters:
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
Returns:
K : array, shape = [n_samples, n_bvectors]

kernel matrix