pyriemann.transfer.encode_domains

pyriemann.transfer.encode_domains(X, y, domain)

Encode the domains of the data in the labels.

We handle the possibility of having different domains for the datasets by extending the labels of the data and including this information to them. For instance, if we have a datum X with class left_hand on the domain_01 then its extended label will be domain_01/left_hand. Note that if the classes were integers at first, they will be converted to strings.

Parameters:
Xndarray, shape (n_matrices, n_channels, n_channels) or shape (n_vectors, n_ts)

Set of SPD matrices or tangent vectors.

yndarray, shape (n_matrices,) or shape (n_vectors,)

Labels for each matrix or vector.

domainndarray, shape (n_matrices,) or shape (n_vectors,)

Domains for each matrix or vector.

Returns:
X_encndarray, shape (n_matrices, n_channels, n_channels) or shape (n_vectors, n_ts)

The same data given as input.

y_encndarray, shape (n_matrices,) or shape (n_vectors,)

Extended labels for each matrix or vector.

See also

decode_domains

Notes

Added in version 0.4.