To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit d72c2085 authored by Martynka's avatar Martynka 🐕
Browse files

Update tasks.py

parent 4c8dbf9b
......@@ -19,7 +19,7 @@ def left_right_task_data_preparation():
preparator.addFilter(name='Keep immediate saccade', f=lambda events: events['type'].isin(cue) & events['type'].shift(-1).isin(saccade))
preparator.addFilter(name='Keep right direction', f=lambda events: (events['type'].isin(['10']) & events['type'].shift(-1).isin(saccade) & (events['end_x'].shift(-1) < 400))
| (events['type'].isin(['11']) & events['type'].shift(-1).isin(saccade) & (events['end_x'].shift(-1) > 400)))
preparator.addFilter(name='Keep saccade if it comes after a meaningful reaction time', f=lambda events: events['latency'].shift(-1) - events['latency'] > 50)
preparator.addFilter(name='Keep saccade if it comes after a reasonable reaction time', f=lambda events: events['latency'].shift(-1) - events['latency'] > 50)
preparator.addFilter(name='Keep only the ones with big enough amplitude', f=lambda events: events['amplitude'].shift(-1) > 2)
preparator.addLabel(name='Giving label 0 for left and 1 for right', f=lambda events: events['type'].apply(lambda x: 0 if x == '10' else 1))
preparator.run()
......@@ -40,7 +40,7 @@ def left_right_task_feature_extraction_data_preparation():
preparator.addFilter(name='Keep saccade that has previously a cue', f=lambda events: events['type'].isin(saccade) & events['type'].shift(1).isin(cue))
preparator.addFilter(name='Keep right direction', f=lambda events: (events['type'].shift(1).isin(['10']) & events['type'].isin(saccade) & (events['end_x'] < 400))
| (events['type'].shift(1).isin(['11']) & events['type'].isin(saccade) & (events['end_x'] > 400)))
preparator.addFilter(name='Keep saccade if it comes after a meaningful reaction time', f=lambda events: events['latency'] - events['latency'].shift(1) > 50)
preparator.addFilter(name='Keep saccade if it comes after a reasonable reaction time', f=lambda events: events['latency'] - events['latency'].shift(1) > 50)
preparator.addFilter(name='Keep only the ones with big enough amplitude', f=lambda events: events['amplitude'] > 2)
preparator.addLabel(name='Giving label 0 for left and 1 for right', f=lambda events: events['type'].shift(1).apply(lambda x: 0 if x == '10' else 1))
preparator.run()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment