Feature#

class braintools.cogtask.Feature(num, name=None)[source]#

Individual feature encoder for cognitive task inputs/outputs.

A Feature defines the encoding dimensions for a single input or output channel in a cognitive task.

Examples

>>> # Simple fixation feature
>>> fix = Feature(1, 'fixation')
>>> # Stimulus with higher dimensionality
>>> stim = Feature(8, 'stimulus')
>>> # Compose features
>>> all_features = fix + stim
>>> print(all_features.num)  # 9 (1 + 8)
>>> # Repeat features
>>> repeated = Feature(2, 'choice') * 3
>>> # Creates: choice_0, choice_1, choice_2
Parameters:
  • num (int) – Number of dimensions for this feature.

  • name (str) – Feature name. Required for composition.

copy()[source]#

Create a shallow copy of this feature.

Return type:

Feature

shift(num)[source]#

Shift indices by the given amount.