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 c54b2e7a authored by Ard Kastrati's avatar Ard Kastrati
Browse files

Added the preparation method for position task with feature extraction

parent 34ab65b3
......@@ -24,7 +24,7 @@ def left_right_task_data_preparation(feature_extraction = False, verbose=False):
save_file_name=config['output_name'], verbose=verbose)
preparator.extract_data_at_events(extract_pattern=[cue, saccade, fixation], name_start_time='At saccade on-set', start_time=lambda events: events['latency'].shift(-1),
name_length_time='Fixed blocks of 1', length_time=1,
start_channel=1, end_channel=129, padding=False)
start_channel=1, end_channel=258, padding=False)
preparator.blocks(on_blocks=['20'], off_blocks=['30']) # take only blocks of pro-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))
......@@ -61,7 +61,7 @@ def direction_task_data_preparation(feature_extraction=False, verbose=False):
name_start_time='At saccade on-set',
start_time=lambda events: (events['latency'].shift(-3)),
name_length_time='Fixed blocks of 1', length_time=1,
start_channel=1, end_channel=129, padding=False)
start_channel=1, end_channel=258, padding=False)
preparator.blocks(on_blocks=['55'], off_blocks=['56']) # take only blocks 55
preparator.ignoreEvent(name='Ignore microsaccades', f=(lambda events: events['type'].isin(saccade) & (events['amplitude'] < 2)))
......@@ -90,7 +90,7 @@ def direction_with_processing_speed_dataset(feature_extraction=False, verbose=Fa
load_file_pattern=config['PROCESSING_SPEED_HILBERT_FILE_PATTERN'], save_file_name=config['output_name'], verbose=verbose)
preparator.extract_data_at_events(extract_pattern=[fixation, saccade, fixation], name_start_time='at saccade onset', start_time=lambda events: (events['latency'].shift(-1)),
name_length_time='Size 1', length_time=1,
start_channel=1, end_channel=129, padding=False) # we are interested only on saccade on-set (where the data is feature extracted by hilbert trafo)
start_channel=1, end_channel=258, padding=False) # we are interested only on saccade on-set (where the data is feature extracted by hilbert trafo)
preparator.addFilter(name='Keep only long enough fixations1', f=lambda events:events['duration'] > 50)
preparator.addFilter(name='Keep only big enough saccade', f=lambda events: events['amplitude'].shift(-1) > 0.5)
......@@ -111,7 +111,14 @@ def position_task_data_preparation(feature_extraction, verbose=False):
name_length_time='Fixed blocks of 500', length_time=500,
start_channel=1, end_channel=129, padding=False) # we are interested only on the fixations (at a dot)
else:
raise NotImplementedError("How should feature extraction be for predicting position?")
preparator = Preparator(load_directory=config['LOAD_DOTS_PATH'], save_directory=config['SAVE_PATH'],
load_file_pattern=config['DOTS_HILBERT_FILE_PATTERN'], save_file_name=config['output_name'],
verbose=verbose)
preparator.extract_data_at_events(extract_pattern=[fixation], name_start_time='At fixation start',
start_time=lambda events: (events['latency']),
name_length_time='Fixed blocks of 1', length_time=1,
start_channel=1, end_channel=258,
padding=False) # we are interested only on the fixations
preparator.blocks(on_blocks=['55'], off_blocks=['56']) # take only blocks 55
preparator.addFilter(name='Keep fixation that are long enough', f=lambda events: events['duration'] >= 500)
......
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