pyriemann.embedding.barycenter_weights

pyriemann.embedding.barycenter_weights(X, Y, indices, metric='riemann', kernel=None, reg=0.001)

Compute Riemannian barycenter weights of X from Y along the first axis.

Estimates the weights to assign to each point in Y[indices] to recover the point X[i] by geodesic interpolation. The barycenter weights sum to 1.

Parameters:
Xndarray, shape (n_matrices, n_channels, n_channels)

Set of SPD matrices.

Yndarray, shape (n_matrices, n_channels, n_channels)

Set of SPD matrices.

indicesndarray, shape (n_matrices, n_neighbors)

Indices of the points in Y used to compute the barycenter

metric{“euclid”, “logeuclid”, “riemann”}, default=”riemann”

Kernel metric.

kernelcallable | None, default=None

Kernel function to use for the embedding. If None, the canonical kernel specified by the metric is used. Must be a function that takes the arguments (X, Cref, metric).

regfloat, default=1e-3

Amount of regularization to add for the problem to be well-posed in the case of n_neighbors > n_channels.

Returns:
Bndarray, shape (n_matrices, n_neighbors)

Interpolation weights.

Notes

New in version 0.3.