Select¶
- class torcheeg.transforms.Select(key: str | List)[source][source]¶
Select part of the value from the information dictionary.
from torcheeg import transforms t = transforms.Select(key='valence') t(y={'valence': 4.5, 'arousal': 5.5, 'subject_id': 7})['y'] >>> 4.5
Select
allows multiple values to be selected and returned as a list. Suitable for multi-classification tasks or multi-task learning.from torcheeg import transforms t = transforms.Select(key=['valence', 'arousal']) t(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.