Skip to content

DOC eldele2021 sleep tutorial: split by subject, as the text says - #1559

Merged
bruAristimunha merged 3 commits into
braindecode:masterfrom
bruAristimunha:fix/eldele-tutorial-split
Nov 8, 2026
Merged

bruAristimunha merged 3 commits into
braindecode:masterfrom
bruAristimunha:fix/eldele-tutorial-split

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

Summary

plot_sleep_staging_eldele2021.py says "Subjects 0-3 are used for training and subjects 4-5 for validation", but BaseConcatDataset.split takes recording indices, not subject ids. With two nights per subject, train=[0, 1, 2, 3] / valid=[4, 5] meant subjects 0-1 for training and subject 2 for validation; subjects 3-5 were loaded and never used.

Changes

  • Load subjects 0-2 and split by looking the subjects up in the "subject" description column, so the code does what the text says and no night of the validation subject is seen in training.
  • This is exactly the split the hosted checkpoint braindecode/plot_sleep_staging_eldele2021 was trained with, so the loaded weights and the displayed history stay consistent (its card now documents this split).

Testing

  • Ran the full example end to end on Voyager (Sleep-EDF download, training, checkpoint load from the Hub, report): exit 0, 677 validation sequences, balanced accuracy 0.75 / accuracy 0.74.
  • pre-commit clean.

split() takes recording indices, so the old ids [0-3]/[4, 5] trained on
subjects 0-1 and validated on subject 2, while the text said subjects 0-3 and
4-5. Look the subjects up in the description, and load subjects 0-2: the same
split the hosted checkpoint (braindecode/plot_sleep_staging_eldele2021) was
trained with.
Copilot AI balanced review requested due to automatic review settings November 8, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues blocking the tutorial’s subject-split correction.

No open issues 🎉

What changed in this PR

Corrects the sleep-staging tutorial’s subject split so the code and explanation agree while preserving the split used by the pretrained checkpoint.

Changes:

  • Loads only subjects 0–2, using subjects 0–1 for training and subject 2 for validation.
  • Looks up recording indices through the "subject" metadata column, keeping both nights of each subject in the same split.
File Description
examples/​applied_examples/​plot_sleep_staging_eldele2021.py Updates subject selection, derives recording indices by subject, and aligns the explanatory comments.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 8, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the tutorial’s subject-split correction.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 8, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Removed reStructuredText heading underlines in docs/whats_new.rst must be restored so release names and change categories render as section titles and remain in section navigation.

1 open issue

Review effort: Balanced

Comment thread docs/whats_new.rst
@@ -23,10 +23,8 @@


Current 2.1.0 (GitHub)
@codecov

codecov Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.48%. Comparing base (e031f8f) to head (2d9dc24).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1559   +/-   ##
=======================================
  Coverage   91.48%   91.48%           
=======================================
  Files         170      170           
  Lines       22277    22277           
=======================================
  Hits        20379    20379           
  Misses       1898     1898           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bruAristimunha
bruAristimunha merged commit dba9d42 into braindecode:master Nov 8, 2026
10 checks passed
bruAristimunha added a commit to bruAristimunha/braindecode that referenced this pull request Nov 9, 2026
Brings in dba9d42 (braindecode#1559, braindecode#1557). No conflicts; NOTICE.txt and docs/whats_new.rst differ from master only by the MEGGPT lines.
bruAristimunha added a commit to bruAristimunha/braindecode that referenced this pull request Nov 9, 2026
bruAristimunha added a commit to bruAristimunha/braindecode that referenced this pull request Nov 9, 2026
Brings in the ch_mask series (braindecode#1545 braindecode#1548 braindecode#1540 braindecode#1549 braindecode#1542 braindecode#1543 braindecode#1544 braindecode#1550), braindecode#1557 and braindecode#1559 (master dba9d42). No conflicts; NOTICE.txt and docs/whats_new.rst carry only this PR's additions over master.
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