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

[WIP] Adding a A large EEG database with users' profile information for motor imagery Brain-Computer Interface dataset #404

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5d5a366
Adding a new dataset
Sara04 Jun 21, 2023
cc5de0c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2023
4c4ec42
Add data loading, update docstring
Sara04 Jun 23, 2023
a6786ea
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jun 23, 2023
594a306
merge
Sara04 Jun 23, 2023
7efaf94
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 23, 2023
2da66cd
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Jun 26, 2023
8bcbb06
Update dataset and add example
Sara04 Jun 27, 2023
d468441
Merge branch 'Dreyer2023_MI_dataset' of https://github.com/Sara04/moa…
Sara04 Jun 27, 2023
8e6eef0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2023
ebce567
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jun 27, 2023
e146fb8
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jun 29, 2023
cc33198
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jul 3, 2023
e4e7ee9
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Jul 4, 2023
c4ce3eb
Update Dreyer 2023 dataset class and example
Sara04 Jul 5, 2023
d5e7b8f
Remove loading info before db is downloaded
Sara04 Jul 5, 2023
fb157b7
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Jul 8, 2023
d8993fc
Merge branch 'NeuroTechX:develop' into Dreyer2023_MI_dataset
Sara04 Jul 10, 2023
8f001e4
Merge branch 'develop' into Dreyer2023_MI_dataset
Sara04 Nov 17, 2023
2386c96
Update dataset session and run naming; update plotting
Sara04 Nov 18, 2023
c353080
Add whats_new
Sara04 Nov 18, 2023
3e21b66
Add words to ignore in pre commit config
Sara04 Nov 18, 2023
77620b4
Add words to ignore in pre commit config
Sara04 Nov 18, 2023
5fbde2d
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Apr 11, 2024
fac087d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 11, 2024
d9ddebe
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Apr 11, 2024
09ed4b6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 11, 2024
3beed67
Merge branch 'develop' into Dreyer2023_MI_dataset
bruAristimunha Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] committed Jun 27, 2023
commit 8e6eef0d262d94fad7a9d7d2c4ba58bb4d17a719
51 changes: 28 additions & 23 deletions examples/plot_Dreyer_clf_scores_vs_subj_info.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import moabb
from moabb.datasets import Dreyer2023A, Dreyer2023B, Dreyer2023C
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sb
from mne.decoding import Vectorizer
from pyriemann.estimation import Covariances
from pyriemann.spatialfilters import CSP
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
from sklearn.pipeline import make_pipeline

import moabb
from moabb.datasets import Dreyer2023A
from moabb.datasets import Dreyer2023A, Dreyer2023B, Dreyer2023C
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from moabb.datasets import Dreyer2023A, Dreyer2023B, Dreyer2023C
from moabb.datasets import Dreyer2023A

B & C not used here

from moabb.evaluations import WithinSessionEvaluation
from moabb.paradigms import MotorImagery
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA

from pyriemann.estimation import Covariances
from pyriemann.spatialfilters import CSP
from sklearn.pipeline import make_pipeline
from mne.decoding import Vectorizer
import matplotlib.pyplot as plt
import seaborn as sb
import pandas as pd

dreyer2023 = Dreyer2023A()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dreyer2023 = Dreyer2023A()
dreyer2023 = Dreyer2023A()
dreyer2023.subject_list = dataset.subject_list[:6]

Generating documentation uses lots of computational ressources, both for CPU and network bandwidth. We try to limit as much as possible the datasets downloaded for generating docs (they are shared between the examples). As the user's profile included in this dataset could give some interesting insight, we could consider to add this dataset in the documentation, but it should use only a selection of subjects to keep the bandwidth usage within reasonable limits. Could you adapt the above line to select only a representative individual for your analysis below. If you could keep the number of subjects between 4 and 8, it will really lower the doc building time.
Cherry picking subjects for the documentation is allowed ^^

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I've selected 4 subjects (to include all combinations of participants' and experimenters' genders). However, since data of all subjects are zipped they all need to be downloaded together, is there some solution for this?

Copy link
Member

Choose a reason for hiding this comment

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

No unfortunately.
The only possibility I see is to make this example a static one, that is you change the name of the file into Dreyer_clf_scores_vs_subj_info.py (without the plot_ prefix) and Sphinx won't execute this example, only display the code. If you want, you could generate a figure on your computer and upload it in a new folder examples/images/, then you could include the resulting image from your example code (see for example this page or that page).

paradigm = MotorImagery()
pipelines = {}
pipelines['CSP+LDA'] = make_pipeline(Covariances(estimator="oas"),
CSP(nfilter=6),
LDA(solver="lsqr", shrinkage="auto"))

evaluation = WithinSessionEvaluation(paradigm=paradigm, datasets=[dreyer2023],
suffix="examples", overwrite=False)
pipelines["CSP+LDA"] = make_pipeline(
Covariances(estimator="oas"), CSP(nfilter=6), LDA(solver="lsqr", shrinkage="auto")
)

evaluation = WithinSessionEvaluation(
paradigm=paradigm, datasets=[dreyer2023], suffix="examples", overwrite=False
)
results = evaluation.process(pipelines)


##############################################################################
info = dreyer2023.get_subject_info(infos=['Demo_Bio'])
info = dreyer2023.get_subject_info(infos=["Demo_Bio"])
results_info = pd.concat([info, results], axis=1)
fig, ax = plt.subplots(facecolor="white", figsize=[8, 4])
plt.figure(1)
@@ -43,13 +43,18 @@
)

sb.pointplot(data=results_info, y="score", x="SUJ_gender", ax=ax, palette="Set1")
ax.set_xticklabels(['Man', 'Woman'])
ax.set_xticklabels(["Man", "Woman"])
ax.set_ylabel("ROC AUC")
ax.set_ylim(0.5, 1)

fig, ax2 = plt.subplots(facecolor="white", figsize=[8, 4])

sb.regplot(data=results_info[['score', 'Birth_year']].astype('float32'),
y="score", x="Birth_year", ax=ax2,
scatter_kws = {"color": "black", "alpha": 0.5}, line_kws = {"color": "red"},)
plt.show()
sb.regplot(
data=results_info[["score", "Birth_year"]].astype("float32"),
y="score",
x="Birth_year",
ax=ax2,
scatter_kws={"color": "black", "alpha": 0.5},
line_kws={"color": "red"},
)
plt.show()
Loading