# pyriemann.utils.kernel.kernel_euclid¶

pyriemann.utils.kernel.kernel_euclid(X, Y=None, *, reg=1e-10, **kwargs)

Euclidean kernel between two sets of SPD matrices.

Calculates the Euclidean kernel matrix K of inner products of two sets X and Y of SPD matrices by calculating pairwise:

$K_{i,j} = \text{tr}(X_i Y_j)$
Parameters
Xndarray, shape (n_matrices_X, n_channels, n_channels)

First set of SPD matrices.

YNone | ndarray, shape (n_matrices_Y, n_channels, n_channels), default=None

Second set of SPD matrices. If None, Y is set to X.

regfloat, default=1e-10

Regularization parameter to mitigate numerical errors in kernel matrix estimation.

Returns
Kndarray, shape (n_matrices_X, n_matrices_Y)

The Euclidean kernel matrix between X and Y.

Notes

New in version 0.3.