-
Notifications
You must be signed in to change notification settings - Fork 240
Cross Dataset Evaluation #703
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
fec5185
cross dataset working with pyriemann
EazyAl 6812f12
cross dataset eval
EazyAl c203219
changes to match MOABB syntax and format
EazyAl 5228cbc
deep learning example working, pls make it clean
EazyAl fecf06c
multiple dataset training and testing with braindecode working - plea…
EazyAl d9f598c
Few changes
EazyAl 44cd428
cross dataset eval with examples
EazyAl 6369eed
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6f83dcb
cross dataset eval with examples
EazyAl 2cec69c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4663226
Merge branch 'NeuroTechX:develop' into develop
EazyAl 023a0a7
fix: resolve merge conflicts in cross dataset example
EazyAl 4a8bcb9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 96a678a
added tests and edited changelog
EazyAl d6d1d00
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 669b8a9
merge
EazyAl e6d5123
merging
EazyAl 0f90c4b
Using match all
EazyAl ae8ac23
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9626ca5
Merge branch 'develop' into develop
bruAristimunha 8269a43
Redesign CrossDatasetEvaluation with CrossDatasetSplitter
bruAristimunha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| """ | ||
| Cross-dataset motor imagery classification | ||
| =========================================== | ||
|
|
||
| This example shows how to train on one dataset (BNCI2014_001) and | ||
| test on another (Zhou2016) using ``CrossDatasetEvaluation``. | ||
| Channel alignment and resampling are handled automatically. | ||
| """ | ||
|
|
||
| import matplotlib.pyplot as plt | ||
| from pyriemann.estimation import Covariances | ||
| from pyriemann.spatialfilters import CSP | ||
| from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA | ||
| from sklearn.pipeline import make_pipeline | ||
|
|
||
| from moabb import set_log_level | ||
| from moabb.datasets import BNCI2014001, Zhou2016 | ||
| from moabb.evaluations import CrossDatasetEvaluation | ||
| from moabb.paradigms import LeftRightImagery | ||
|
|
||
| set_log_level("WARNING") | ||
|
|
||
| paradigm = LeftRightImagery() | ||
|
|
||
| train_dataset = BNCI2014001() | ||
| test_dataset = Zhou2016() | ||
|
|
||
| pipelines = { | ||
| "CSP+LDA": make_pipeline(Covariances("oas"), CSP(nfilter=6), LDA()), | ||
| } | ||
|
|
||
| evaluation = CrossDatasetEvaluation( | ||
| paradigm=paradigm, | ||
| train_datasets=train_dataset, | ||
| test_datasets=test_dataset, | ||
| ) | ||
|
|
||
| results = evaluation.process(pipelines) | ||
|
|
||
| print(results[["dataset", "subject", "session", "score"]]) | ||
|
|
||
| fig, ax = plt.subplots(figsize=(8, 5)) | ||
| results.boxplot(column="score", by="pipeline", ax=ax) | ||
| ax.set_title("Cross-dataset: BNCI2014_001 -> Zhou2016") | ||
| ax.set_ylabel("Score") | ||
| plt.suptitle("") | ||
| plt.tight_layout() | ||
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.