-
Notifications
You must be signed in to change notification settings - Fork 187
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
5d5a366
cc5de0c
4c4ec42
a6786ea
594a306
7efaf94
2da66cd
8bcbb06
d468441
8e6eef0
ebce567
e146fb8
cc33198
e4e7ee9
c4ce3eb
d5e7b8f
fb157b7
d8993fc
8f001e4
2386c96
c353080
3e21b66
77620b4
5fbde2d
fac087d
d9ddebe
09ed4b6
3beed67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||||||||
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() | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No unfortunately. |
||||||||
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B & C not used here