-
Notifications
You must be signed in to change notification settings - Fork 2
Brain disorder diagnosis notebook rework #13
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
Conversation
…best model, and pyg wheel during pip install
…or comparing eval splits
…ix for fc visualization
…including quizzes, extra tasks, and more
- update runtime output with top-10 sites - update the plot format and description - add estimated runtime for long running cells - update interpretation and answer
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.
Pull Request Overview
This PR introduces a comprehensive rework of the brain disorder diagnosis tutorial notebook along with several updates in helper functions, configuration, and experiment setup files.
- Restructures the diagnostic notebook and adds new visualization and helper functions.
- Updates preprocessing logic (including a change in handedness mapping) and extends parameter parsing.
- Revises YAML experiment configuration files and project config for improved resource management.
Reviewed Changes
Copilot reviewed 10 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tutorials/brain-disorder-diagnosis/visualization.py | Adds functions to plot phenotypic distributions and functional connectivity matrices. |
| tutorials/brain-disorder-diagnosis/preprocess.py | Updates phenotypic data processing, including a change in handedness mapping and an option to one-hot encode categories. |
| tutorials/brain-disorder-diagnosis/parsing.py | Introduces the parse_param_grid helper function for dynamic hyperparameter grid construction. |
| tutorials/brain-disorder-diagnosis/experiments/skf/tmi2022.yml | Defines configuration for skf experiments including cross-validation and parameter grid settings. |
| tutorials/brain-disorder-diagnosis/experiments/skf/base.yml | Provides baseline settings for skf experiments including dataset and trainer configurations. |
| tutorials/brain-disorder-diagnosis/experiments/lpgo/tmi2022.yml | Sets up configuration for lpgo experiments with updated parameter grid values. |
| tutorials/brain-disorder-diagnosis/experiments/lpgo/base.yml | Updates baseline experiment settings for the lpgo pipeline, including an increased NUM_SEARCH_ITER value. |
| tutorials/brain-disorder-diagnosis/data.py | Adds support for selecting the top K sites when loading data to filter subjects by site frequency. |
| tutorials/brain-disorder-diagnosis/config.py | Renames and adds configuration keys (e.g., DATA_DIR, TOP_K_SITES) for improved resource handling. |
| _config.yml | Updates project configuration with new logo and favicon paths along with additional Sphinx extensions. |
Comments suppressed due to low confidence (2)
tutorials/brain-disorder-diagnosis/preprocess.py:36
- The mapping for handedness has changed from 'LEFT' to 'RIGHT' for both '-9999' and np.nan. Verify that this change aligns with the intended diagnostic criteria.
"-9999": "RIGHT",
tutorials/brain-disorder-diagnosis/experiments/lpgo/base.yml:10
- [nitpick] Increasing NUM_SEARCH_ITER to 100 may significantly impact computation time; confirm that this value is optimal for the intended performance requirements.
NUM_SEARCH_ITER: 100
| - [domain_adapter__num_components, [50, 150, 300]] | ||
| - [domain_adapter__mu, [0.25, 0.5, 0.75, 1.0]] | ||
| - [domain_adapter__ignore_y, [True]] | ||
| - [domain_adapter__augment, [pre, post, null]] |
Copilot
AI
Jun 28, 2025
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.
Consider quoting the values 'pre', 'post', and 'null' in the parameter grid to ensure they are parsed as strings in YAML.
| - [domain_adapter__augment, [pre, post, null]] | |
| - [domain_adapter__augment, ['pre', 'post', 'null']] |
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.
Using 'null' might made yacs mis-parsed it as a string, as the expected result is null = None.
| - [domain_adapter__num_components, [50, 150, 300]] | ||
| - [domain_adapter__mu, [0.25, 0.5, 0.75, 1.0]] | ||
| - [domain_adapter__ignore_y, [True]] | ||
| - [domain_adapter__augment, [pre, post, null]] |
Copilot
AI
Jun 28, 2025
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.
Consider quoting the values 'pre', 'post', and 'null' in the parameter grid to ensure they are parsed as strings in YAML.
| - [domain_adapter__augment, [pre, post, null]] | |
| - [domain_adapter__augment, ['pre', 'post', 'null']] |
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.
Using 'null' might made yacs mis-parsed it as a string, as the expected result is null = None.
This PR introduces an almost complete rework of the brain disorder diagnosis tutorial notebook and some changes regarding the structure to store resources for the book (e.g., logo and icon).
Notebook
base.ymlfiles for bothlpgoandskfevaluation.lpgoandskf.skfexperiment result to compare with the defaultlpgoruntime used for the experiment to highlight the improvements when applyingMIDA.tmi2022.ymlfile to replicate the param grid found in Kunda et al. (2022)'s source code.Helper Functions
visualization.pyto aid in visualizing phenotypic data distributions and FCs.parse_param_gridtoparsingto workaroundyacslimitation to dynamically defineparam_grid.top_k_sitesinload_datafromdata.pyto sample thek-largest sites.top_k_sitesinconfig.py.Book Project Structure Reorganization
favicon.icoicon.resources.sphinx_exerciseto aid in generating RST-style exercise.torch-geometricandsphinx_exerciseinrequirements.py.nilearnversion.Note
mainbranch.jupyter-book, the Colab runtime will not render it as it doesn't support RST rendering.