polylearn.kernels.anova_kernel

polylearn.kernels.anova_kernel(X, P, degree=2)[source]

ANOVA kernel between X and P:

K_A(x, p) = sum_i1>i2>...>id x_i1 p_i1 x_i2 p_i2 ... x_id p_id

See John Shawe-Taylor and Nello Cristianini, Kernel Methods for Pattern Analysis section 9.2.

Parameters:

X : ndarray of shape (n_samples_1, n_features)

Y : ndarray of shape (n_samples_2, n_features)

degree : int, default 2

Returns:

Gram matrix : array of shape (n_samples_1, n_samples_2)