pyriemann.datasets.make_classification_transfer¶
- pyriemann.datasets.make_classification_transfer(n_matrices, class_sep=3.0, class_disp=1.0, domain_sep=5.0, theta=0.0, stretch=1.0, random_state=None, class_names=[1, 2])¶
Generate source and target toy datasets for transfer learning examples.
Generate a dataset with 2x2 SPD matrices drawn from two Riemannian Gaussian distributions. The distributions have the same class dispersions and the distance between their centers of mass is an input parameter. We can stretch the target dataset and control a rotation matrix that maps the source to the target domains. This function is useful for testing classification or clustering methods on transfer learning applications.
- Parameters
- n_matricesint, default=100
How many 2x2 matrices to generate for each class on each domain.
- class_sepfloat, default=3.0
Distance between the centers of the two classes.
- class_dispfloat, default=1.0
Dispersion of the data points to be sampled on each class.
- domain_sepfloat, default=5.0
Distance between the global means of each source and target datasets.
- thetafloat, default=0.0
Angle of the 2x2 rotation matrix from source to target dataset.
- stretchfloat, default=1.0
Factor to stretch the data points in target dataset. Note that when it is != 1.0 the class dispersions in target domain will be different than those in source domain (fixed at class_disp).
- random_stateNone | int | RandomState instance, default=None
Pass an int for reproducible output across multiple function calls.
- class_nameslist, default=[1, 2]
Names of classes.
- Returns
- X_encndarray, shape (4*n_matrices, 2, 2)
Set of SPD matrices.
- y_encndarray, shape (4*n_matrices,)
Extended labels for each data point.
Notes
New in version 0.3.1.