ICML 2018 Reproducible Machine Learning - A. Gramfort

A
Reproducible ML:
software challenges, anecdotes and
some engineering solutions 
Alexandre Gramfort
http://alexandre.gramfort.net
GitHub : @agramfort Twitter : @agramfort
FreeSurfer: popular software for extracting features from MRI
(e.g. cortical thickness used to predict Alzheimer’s disease, etc.)
https://surfer.nmr.mgh.harvard.edu/
FreeSurfer: popular software for extracting features from MRI
(e.g. cortical thickness used to predict Alzheimer’s disease, etc.)
https://surfer.nmr.mgh.harvard.edu/
FreeSurfer: popular software for extracting features from MRI
(e.g. cortical thickness used to predict Alzheimer’s disease, etc.)
Hardware and software
differences can lead to different
features / statistical results and
scientific conclusions
https://surfer.nmr.mgh.harvard.edu/
https://github.com/mne-tools/mne-python/issues/4922
ICA: popular matrix factorization problem. Infomax does an SGD on the
non-convex log-likelihood function
https://github.com/mne-tools/mne-python/issues/4922
ICA: popular matrix factorization problem. Infomax does an SGD on the
non-convex log-likelihood function
Changing BLAS/Lapack
backends changes results
Even changing OMP_NUM_THREADS
can change the results
https://github.com/scikit-learn/scikit-learn/issues/5545
https://github.com/scikit-learn/scikit-learn/issues/5545
Even on the same machine numerical
solvers can lead to different outcomes
A. Gramfort - HdR - Bridging gaps between neuroimaging, ML and optimization
Some software engineering solutions
for reproducible ML
http://scikit-learn.org
http://scikit-learn.org
526,000 users in the last 30 days
42,000,000 pages views in last year
http://scikit-learn.org
526,000 users in the last 30 days
42,000,000 pages views in last year
Big user base
higher chance of
spotting issues
Alex Gramfort Reproducible ML: challenges and some engineering solutions 
Do not reinvent the wheel…
7
#JSM2016Jake VanderPlas
We provide one
component in the
Python ecosystem
Alex Gramfort Reproducible ML: challenges and some engineering solutions 
Do not reinvent the wheel…
7
#JSM2016Jake VanderPlas
We provide one
component in the
Python ecosystem
Code reuse and
tight community
Bigger user base
https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/decomposition/tests/test_pca.py
Unit test
Docstring tests
alex@:scikit-learn(master)$ cloc --not-match-d='tests' --force-lang=Python sklearn/
427 text files.
426 unique files.
29 files ignored.
[…]
———————————————————————————————————————
Language files blank comment code
-------------------------------------------------------------------------------
Python 426 83679 395769 552905
-------------------------------------------------------------------------------
alex@:scikit-learn(master)$ cloc --match-d='tests' --force-lang=Python sklearn/
168 text files.
168 unique files.
25 files ignored.
[…]
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Python 168 13153 7014 45710
-------------------------------------------------------------------------------
Not even counting docstrings….
45,000 lines of test!
Continuous integration on all platforms
Win/OSX/Linux
from Py 2.7 to 3.7
Coverage
Simplifying code reuse with sphinx-gallery
sphinx-gallery:
Write doc by writing
Python code
Sphinx-Gallery
https://sphinx-gallery.readthedocs.io
Extracted from scikit-learn
and funded by:
Sphinx-Gallery
Sphinx-Gallery
https://mybinder.org/
Simplifying code reuse with sphinx-gallery
Sphinx-Gallery
https://sphinx-gallery.readthedocs.io
Configuring sphinx-gallery is really easy:
How to go even further?
Open Data
http://jaberg.github.io/skdata/
http://www.dmi.usherb.ca/~larocheh/mlpython/
Some oldies…
Many more…
https://www.nih.gov/news-events/news-releases/nih-clinical-center-provides-one-largest-publicly-available-chest-x-ray-datasets-scientific-community
Open Data
https://www.nih.gov/news-events/news-releases/nih-clinical-center-provides-one-largest-publicly-available-chest-x-ray-datasets-scientific-community
Open Data
Open Data
Open Data
https://mlperf.org/
But DATA isn’t much…
… without evaluation platforms
https://mlperf.org/ Reproducible
benchmarks
https://www.ramp.studio/
https://www.ramp.studio/
RAMP: Challenge
with code
submission
https://paris-saclay-cds.github.io/autism_challenge/
Reproducible
challenges
https://www.ramp.studio/
https://www.ramp.studio/
Allows to:
• Run code on private data
• Pick model with good accuracy/perf tradeoff
So in the end maybe we
can easily do better?
Alex Gramfort Reproducible ML: challenges and some engineering solutions 
Wrapping up
24
• Even hardware/software replication is hard and costly
Alex Gramfort Reproducible ML: challenges and some engineering solutions 
Wrapping up
24
• Even hardware/software replication is hard and costly
• Disclaimer: Not every problem has an engineering solution
Alex Gramfort Reproducible ML: challenges and some engineering solutions 
Wrapping up
24
• Even hardware/software replication is hard and costly
Sphinx-Gallery
• Yet, technology and engineering can make ML more replicable
• Modern science is Open Science
• Disclaimer: Not every problem has an engineering solution
Alexandre Gramfort
http://alexandre.gramfort.netContact:
GitHub : @agramfort Twitter : @agramfort
"An approximate answer to the right problem is worth a good deal more than an exact
answer to an approximate problem. ~ JohnTukey"
Support:
1 of 38

More Related Content

ICML 2018 Reproducible Machine Learning - A. Gramfort