-
Notifications
You must be signed in to change notification settings - Fork 580
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
[MRG] Iter age group prediction example #2063
[MRG] Iter age group prediction example #2063
Conversation
jeromedockes
commented
May 17, 2019
•
edited
Loading
edited
- warn about small sample size
- simplify cross-val code with gridsearch
- include tangent space fitting in the cross-validated pipeline
- show cross-val score standard deviation on the bar plot
Codecov Report
@@ Coverage Diff @@
## master #2063 +/- ##
=======================================
Coverage 94.98% 94.98%
=======================================
Files 141 141
Lines 18298 18298
=======================================
Hits 17380 17380
Misses 918 918 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #2063 +/- ##
==========================================
+ Coverage 92.21% 92.38% +0.16%
==========================================
Files 149 149
Lines 18752 18761 +9
Branches 2277 2279 +2
==========================================
+ Hits 17293 17333 +40
+ Misses 944 917 -27
+ Partials 515 511 -4
Continue to review full report at Codecov.
|
failure is related to #2056 and not this PR. |
ping @GaelVaroquaux or @KamalakerDadi for a review |
Is this blocked by #2035 ? |
Is this blocked by #2035 ?
I don't think so. I think it is waiting to be either reviewed or closed.
|
I can review if that's helpful ? Though I don't think it counts towards an official "approval." |
I can review if that's helpful ?
It is.
|
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.
I think this is a big improvement, thanks @jeromedockes ! Small questions and comments.
@@ -57,7 +39,7 @@ def plot_matrices(matrices, matrix_kind): | |||
|
|||
masker = input_data.NiftiMapsMasker( | |||
msdl_data.maps, resampling_target="data", t_r=2, detrend=True, | |||
low_pass=.1, high_pass=.01, memory='nilearn_cache', memory_level=1) | |||
low_pass=.1, high_pass=.01, memory='nilearn_cache', memory_level=1).fit([]) |
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.
What's the reasoning for adding the .fit()
here distinct from .fit_transform()
as previously ? It feels less explicit, as a reader.
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.
because the masker is not fitted on the data provided to transform (or fit_transform)
############################################################################### | ||
# Finally, we can display the classification scores. | ||
from nilearn.plotting import show | ||
print(kind) |
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.
I'm not sure what this print statement adds, other than having an output between the cells. Slight stylistic preference to drop -- feel free to ignore.
# We study only 60 subjects from the dataset, to save computation time. | ||
from nilearn import datasets | ||
|
||
rest_data = datasets.fetch_development_fmri(n_subjects=60) |
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.
rest_data
might be misleading, here, since they're watching a movie. Maybe just func_data
?
|
||
masker = NiftiMapsMasker( | ||
msdl_data.maps, resampling_target="data", t_r=2, detrend=True, | ||
low_pass=.1, high_pass=.01, memory='nilearn_cache', memory_level=1).fit([]) |
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.
Same question as above on empty .fit
as opposed to .fit_transform
Co-Authored-By: Elizabeth DuPre <emd222@cornell.edu> Co-Authored-By: bthirion <bertrand.thirion@inria.fr>
Pulling from master should resolve the CircleCI failure |
Pulling from master should resolve the CircleCI failure
thanks!
|
I am assuming no more comments. I will merge this PR on Wednesday. |
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.
I don't have strong opinion on the advanced example. I would like to convert this advanced example into teaching material by adding them into user guide in the functional connectivity slot. AFAIK there is no guide showing supervised learning based on functional connectomes.
@@ -1,43 +1,25 @@ | |||
""" | |||
Functional connectivity matrices for group analysis of connectomes | |||
================================================================== | |||
Functional connectivity predicts age group |
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.
I would write "Functional connectome-based classification of age groups". You can write predict but I am more used to listen this on a continuous range scale.
development_dataset.func, | ||
development_dataset.confounds, | ||
development_dataset.phenotypic): | ||
time_series = masker.transform(func_file, confounds=confound_file) |
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 fit_transform
is straight-forward. I feel.
|
This needs a whats_new entry. |
…s_brain_orientation * 'master' of https://github.com/nilearn/nilearn: (116 commits) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) Update Schaefer parcelation to v0.14.3 (nilearn#2138) MAINT: Future-compatible cmap reversal (nilearn#2131) fix openmp crash (nilearn#2140) change nose to pytest on appveyor (nilearn#2130) adding fix to whatsnew fix wrong urls in nki dataset Made Flake8 happy added whats_new ... # Conflicts: # doc/whats_new.rst
…lot_connectome_strength * 'master' of https://github.com/nilearn/nilearn: (272 commits) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) Update Schaefer parcelation to v0.14.3 (nilearn#2138) MAINT: Future-compatible cmap reversal (nilearn#2131) fix openmp crash (nilearn#2140) change nose to pytest on appveyor (nilearn#2130) adding fix to whatsnew fix wrong urls in nki dataset Made Flake8 happy ... # Conflicts: # examples/03_connectivity/plot_sphere_based_connectome.py
…ounds_for_connectome * 'master' of https://github.com/nilearn/nilearn: (227 commits) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) Update Schaefer parcelation to v0.14.3 (nilearn#2138) MAINT: Future-compatible cmap reversal (nilearn#2131) fix openmp crash (nilearn#2140) change nose to pytest on appveyor (nilearn#2130) adding fix to whatsnew fix wrong urls in nki dataset Made Flake8 happy ...
…_roi_contours * 'master' of https://github.com/nilearn/nilearn: (227 commits) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) Update Schaefer parcelation to v0.14.3 (nilearn#2138) MAINT: Future-compatible cmap reversal (nilearn#2131) fix openmp crash (nilearn#2140) change nose to pytest on appveyor (nilearn#2130) adding fix to whatsnew fix wrong urls in nki dataset Made Flake8 happy ...
…nt_modify_fetch_dev * 'master' of https://github.com/nilearn/nilearn: (228 commits) [MRG] Nans in view connectome (nilearn#2166) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) Update Schaefer parcelation to v0.14.3 (nilearn#2138) MAINT: Future-compatible cmap reversal (nilearn#2131) fix openmp crash (nilearn#2140) change nose to pytest on appveyor (nilearn#2130) adding fix to whatsnew fix wrong urls in nki dataset ... # Conflicts: # nilearn/datasets/func.py
…ecomposition * 'master' of https://github.com/nilearn/nilearn: (348 commits) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) Update Schaefer parcelation to v0.14.3 (nilearn#2138) MAINT: Future-compatible cmap reversal (nilearn#2131) fix openmp crash (nilearn#2140) change nose to pytest on appveyor (nilearn#2130) adding fix to whatsnew fix wrong urls in nki dataset Made Flake8 happy ... # Conflicts: # doc/connectivity/resting_state_networks.rst # doc/whats_new.rst # examples/03_connectivity/plot_canica_analysis.py
…smooth-image * 'master' of https://github.com/nilearn/nilearn: (114 commits) [DOC] Update whats_new to reference nilearn#2013 (Merging of several examples) (nilearn#2183) Removed sub-example due to unfit for lasso dataset - unstable float values (nilearn#2177) Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) ...
…te-req-dev * 'master' of https://github.com/nilearn/nilearn: (336 commits) Release Nilearn 0.6.0 alpha (nilearn#2164) Making fetch_localizer_button_task backwards compatibile (nilearn#2182) [DOC] Update whats_new to reference nilearn#2013 (Merging of several examples) (nilearn#2183) Removed sub-example due to unfit for lasso dataset - unstable float values (nilearn#2177) Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) ...