LinearKernel

class rlscore.kernel.linear_kernel.LinearKernel(X, bias=1.0)

Bases: object

Linear kernel.

k(xi,xj) = <xi , xj> + bias

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

Basis vectors

bias : float, optional (default 1.0)

Constant added to each kernel evaluation

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

Basis vectors

bias : float

Constant added to each kernel evaluation

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