Select¶
- class torcheeg.transforms.Select(key: str | List)[source][source]¶
Select part of the value from the information dictionary.
transform = Select(key='valence') transform(y={'valence': 4.5, 'arousal': 5.5, 'subject_id': 7})['y'] >>> 4.5
Selectallows multiple values to be selected and returned as a list. Suitable for multi-classification tasks or multi-task learning.transform = Select(key=['valence', 'arousal']) transform(y={'valence': 4.5, 'arousal': 5.5, 'subject_id': 7})['y'] >>> [4.5, 5.5]
- Parameters:
key (str or list) – The selected key can be a key string or a list of keys.