Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add match_all method in paradigm to support CompoundDataset evaluation with MNE epochs #473

Merged
merged 13 commits into from
Aug 29, 2023

Conversation

gcattan
Copy link
Contributor

@gcattan gcattan commented Aug 28, 2023

CompoundDataset supports the merging of datasets with different sampling frequencies and channels.
When Epochs are used for evaluation, MNE failed to merge epochs with different frequencies and channels.

This PR introduces the match_all method in the BaseParadigm. It initialized the resample and channels members of a paradigm to be compatible with the sampling frequency and channels of all datasets passed as parameters.

@bruAristimunha FYI

Comment on lines 424 to 431
def match_all(self, datasets: List[BaseDataset]):
"""
Initialize this paradigm to match all datasets in parameter:
- `self.resample` is set to match the minimum frequency in all datasets, minus 0.5.
If the frequency is 128 for example, then MNE can returns 128 or 129 samples
depending on the dataset, even if the length of the epochs is 1s
The `-0.5` solves this particular issue.
- `self.channels` is initialized with the channels which are common to all datasets.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the -0.5 Hz a default parameter?

Copy link
Collaborator

@bruAristimunha bruAristimunha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to me, just change the frequency padding to a parameter.

@bruAristimunha
Copy link
Collaborator

bruAristimunha commented Aug 28, 2023

Can you please alter the what's new file? @gcattan

@bruAristimunha bruAristimunha merged commit 3da799d into NeuroTechX:develop Aug 29, 2023
@bruAristimunha
Copy link
Collaborator

Thank you @gcattan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants