Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mind-inria/hidimstat into PR_cpi_lo…
Browse files Browse the repository at this point in the history
…co_pi
  • Loading branch information
jpaillard committed Feb 18, 2025
2 parents 11f9313 + 16ce023 commit d269315
Show file tree
Hide file tree
Showing 71 changed files with 679 additions and 367 deletions.
7 changes: 5 additions & 2 deletions doc_conf/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ HiDimStat depends on the following packages::
numpy
scipy
scikit-learn
pandas
torch
torchmetrics


To run examples it is neccessary to install ``matplotlib``, and to run tests it
Expand Down Expand Up @@ -71,8 +74,8 @@ To build the documentation you will need to run:

.. code-block::
pip install -U sphinx_gallery sphinx_bootstrap_theme
cd doc
pip install -U .[doc]
cd doc_conf
make html
Expand Down
81 changes: 80 additions & 1 deletion doc_conf/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,83 @@ @article{Williamson_General_2023
pages = {1645--1658},
number = {543},
volume = {118},
}
}
}
@article{benjamini1995controlling,
title={Controlling the false discovery rate: a practical and powerful approach to multiple testing},
author={Benjamini, Yoav and Hochberg, Yosef},
journal={Journal of the Royal statistical society: series B (Methodological)},
volume={57},
number={1},
pages={289--300},
year={1995},
publisher={Wiley Online Library}
}


@article{wang2022false,
title={False discovery rate control with e-values},
author={Wang, Ruodu and Ramdas, Aaditya},
journal={Journal of the Royal Statistical Society Series B: Statistical Methodology},
volume={84},
number={3},
pages={822--852},
year={2022},
publisher={Oxford University Press}
}

@article{ramdas2017wasserstein,
title={On wasserstein two-sample testing and related families of nonparametric tests},
author={Ramdas, Aaditya and Garc{\'\i}a Trillos, Nicol{\'a}s and Cuturi, Marco},
journal={Entropy},
volume={19},
number={2},
pages={47},
year={2017},
publisher={MDPI}
}

@article{ramdas2017online,
title={Online control of the false discovery rate with decaying memory},
author={Ramdas, Aaditya and Yang, Fanny and Wainwright, Martin J and Jordan, Michael I},
journal={Advances in neural information processing systems},
volume={30},
year={2017}
}

@article{meinshausen2008hierarchical,
title={Hierarchical testing of variable importance},
author={Meinshausen, Nicolai},
journal={Biometrika},
volume={95},
number={2},
pages={265--278},
year={2008},
publisher={Oxford University Press}
}
@article{meinshausen2009p,
title={P-values for high-dimensional regression},
author={Meinshausen, Nicolai and Meier, Lukas and B{\"u}hlmann, Peter},
journal={Journal of the American Statistical Association},
volume={104},
number={488},
pages={1671--1681},
year={2009},
publisher={Taylor \& Francis}
}

@article{gaonkar_deriving_2012,
title = {Deriving statistical significance maps for {SVM} based image classification and group comparisons},
volume = {15},
url = {https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3703958/},
pages = {723--730},
number = {0},
journaltitle = {Medical image computing and computer-assisted intervention : {MICCAI} ... International Conference on Medical Image Computing and Computer-Assisted Intervention},
journal = {Med Image Comput Comput Assist Interv},
author = {Gaonkar, Bilwaj and Davatzikos, Christos},
urldate = {2024-12-16},
year = {2012},
pmid = {23285616},
pmcid = {PMC3703958},
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.12.9"
}
},
"nbformat": 4,
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from sklearn.linear_model import Ridge
from sklearn.utils import Bunch

from hidimstat.adaptive_permutation_threshold import ada_svr
from hidimstat.ada_svr import ada_svr
from hidimstat.clustered_inference import clustered_inference
from hidimstat.ensemble_clustered_inference import ensemble_clustered_inference
from hidimstat.permutation_test import permutation_test, permutation_test_cv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.12.9"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.12.9"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"outputs": [],
"source": [
"import numpy as np\nimport pandas as pd\nfrom nilearn import datasets\nfrom nilearn.image import mean_img\nfrom nilearn.input_data import NiftiMasker\nfrom nilearn.plotting import plot_stat_map, show\nfrom sklearn.cluster import FeatureAgglomeration\nfrom sklearn.feature_extraction import image\nfrom sklearn.linear_model import Ridge\nfrom sklearn.utils import Bunch\n\nfrom hidimstat.adaptive_permutation_threshold import ada_svr\nfrom hidimstat.clustered_inference import clustered_inference\nfrom hidimstat.ensemble_clustered_inference import ensemble_clustered_inference\nfrom hidimstat.permutation_test import permutation_test, permutation_test_cv\nfrom hidimstat.standardized_svr import standardized_svr\nfrom hidimstat.stat_tools import pval_from_scale, zscore_from_pval"
"import numpy as np\nimport pandas as pd\nfrom nilearn import datasets\nfrom nilearn.image import mean_img\nfrom nilearn.input_data import NiftiMasker\nfrom nilearn.plotting import plot_stat_map, show\nfrom sklearn.cluster import FeatureAgglomeration\nfrom sklearn.feature_extraction import image\nfrom sklearn.linear_model import Ridge\nfrom sklearn.utils import Bunch\n\nfrom hidimstat.ada_svr import ada_svr\nfrom hidimstat.clustered_inference import clustered_inference\nfrom hidimstat.ensemble_clustered_inference import ensemble_clustered_inference\nfrom hidimstat.permutation_test import permutation_test, permutation_test_cv\nfrom hidimstat.standardized_svr import standardized_svr\nfrom hidimstat.stat_tools import pval_from_scale, zscore_from_pval"
]
},
{
Expand Down Expand Up @@ -301,7 +301,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.12.9"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.12.9"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.12.9"
}
},
"nbformat": 4,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,9 @@ randomization.

.. rst-class:: sphx-glr-timing

**Total running time of the script:** (1 minutes 7.791 seconds)
**Total running time of the script:** (1 minutes 3.434 seconds)

**Estimated memory usage:** 710 MB
**Estimated memory usage:** 722 MB


.. _sphx_glr_download_auto_examples_plot_2D_simulation_example.py:
Expand Down
4 changes: 2 additions & 2 deletions docs/_sources/auto_examples/plot_dcrt_example.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ Plotting the comparison

.. rst-class:: sphx-glr-timing

**Total running time of the script:** (1 minutes 3.192 seconds)
**Total running time of the script:** (1 minutes 2.836 seconds)

**Estimated memory usage:** 640 MB
**Estimated memory usage:** 658 MB


.. _sphx_glr_download_auto_examples_plot_dcrt_example.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ Analyze the results
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 8.885 seconds)
**Total running time of the script:** (0 minutes 8.070 seconds)

**Estimated memory usage:** 625 MB
**Estimated memory usage:** 643 MB


.. _sphx_glr_download_auto_examples_plot_diabetes_variable_importance_example.py:
Expand Down
20 changes: 10 additions & 10 deletions docs/_sources/auto_examples/plot_fmri_data_example.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Imports needed for this script
from sklearn.linear_model import Ridge
from sklearn.utils import Bunch
from hidimstat.adaptive_permutation_threshold import ada_svr
from hidimstat.ada_svr import ada_svr
from hidimstat.clustered_inference import clustered_inference
from hidimstat.ensemble_clustered_inference import ensemble_clustered_inference
from hidimstat.permutation_test import permutation_test, permutation_test_cv
Expand Down Expand Up @@ -182,15 +182,15 @@ You may choose a subject in [1, 2, 3, 4, 5, 6]. By default subject=2.
[fetch_single_file] ...done. (0 seconds, 0 min)
[fetch_single_file] Downloading data from http://data.pymvpa.org/datasets/haxby2001/subj2-2010.01.14.tar.gz ...
[_chunk_report_] Downloaded 161644544 of 291168628 bytes (55.5%%, 0.8s remaining)
[_chunk_report_] Downloaded 158236672 of 291168628 bytes (54.3%%, 0.8s remaining)
[fetch_single_file] ...done. (2 seconds, 0 min)
[uncompress_file] Extracting data from /home/runner/nilearn_data/haxby2001/9cabe068089e791ef0c5fe930fc20e30/subj2-2010.01.14.tar.gz...
[uncompress_file] .. done.
/home/runner/work/hidimstat/hidimstat/examples/plot_fmri_data_example.py:88: FutureWarning: From release 0.13.0 onwards, this function will, by default, copy the header of the input image to the output. Currently, the header is reset to the default Nifti1Header. To suppress this warning and use the new behavior, set `copy_header=True`.
bg_img = mean_img(haxby_dataset.anat)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/nilearn/image/resampling.py:489: UserWarning: The provided image has no sform in its header. Please check the provided file. Results may not be as expected.
/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/site-packages/nilearn/image/resampling.py:489: UserWarning: The provided image has no sform in its header. Please check the provided file. Results may not be as expected.
warnings.warn(
Expand Down Expand Up @@ -287,8 +287,8 @@ Now, we compute p-values thanks to permutation tests applied to

.. code-block:: none
[Parallel(n_jobs=1)]: Done 49 tasks | elapsed: 1.5s
[Parallel(n_jobs=1)]: Done 199 tasks | elapsed: 6.6s
[Parallel(n_jobs=1)]: Done 49 tasks | elapsed: 1.6s
[Parallel(n_jobs=1)]: Done 199 tasks | elapsed: 6.4s
Expand Down Expand Up @@ -336,7 +336,7 @@ and high-dimensional inference (c.f. References).
.. code-block:: none
Clustered inference: n_clusters = 500, inference method = desparsified-lasso, seed = 0
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/sklearn/linear_model/_coordinate_descent.py:681: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 1.7422256933791083, tolerance: 0.21600000000000003
/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/site-packages/sklearn/linear_model/_coordinate_descent.py:681: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 1.7422256933791083, tolerance: 0.21600000000000003
model = cd_fast.enet_coordinate_descent_gram(
Expand Down Expand Up @@ -369,7 +369,7 @@ However you might benefit from clustering randomization taking
.. code-block:: none
[Parallel(n_jobs=2)]: Using backend LokyBackend with 2 concurrent workers.
[Parallel(n_jobs=2)]: Done 5 out of 5 | elapsed: 32.3s finished
[Parallel(n_jobs=2)]: Done 5 out of 5 | elapsed: 32.1s finished
Expand Down Expand Up @@ -575,7 +575,7 @@ called `plot_map` that wraps all these steps.

.. code-block:: none
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/nilearn/plotting/displays/_slicers.py:313: UserWarning: empty mask
/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/site-packages/nilearn/plotting/displays/_slicers.py:313: UserWarning: empty mask
ims = self._map_show(img, type="imshow", threshold=threshold, **kwargs)
Expand Down Expand Up @@ -614,9 +614,9 @@ spurious discoveries.
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (1 minutes 22.801 seconds)
**Total running time of the script:** (1 minutes 22.636 seconds)

**Estimated memory usage:** 3279 MB
**Estimated memory usage:** 3316 MB


.. _sphx_glr_download_auto_examples_plot_fmri_data_example.py:
Expand Down
4 changes: 2 additions & 2 deletions docs/_sources/auto_examples/plot_knockoff_aggregation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ Imports needed for this script

.. rst-class:: sphx-glr-timing

**Total running time of the script:** (5 minutes 45.456 seconds)
**Total running time of the script:** (5 minutes 36.077 seconds)

**Estimated memory usage:** 809 MB
**Estimated memory usage:** 823 MB


.. _sphx_glr_download_auto_examples_plot_knockoff_aggregation.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Visualize the data
.. code-block:: none
[<matplotlib.axis.YTick object at 0x7fcb1addca40>, <matplotlib.axis.YTick object at 0x7fcb1adde2a0>, <matplotlib.axis.YTick object at 0x7fca47b25880>, <matplotlib.axis.YTick object at 0x7fca47b26630>, <matplotlib.axis.YTick object at 0x7fca47b247a0>, <matplotlib.axis.YTick object at 0x7fca47b269f0>, <matplotlib.axis.YTick object at 0x7fca47b24fb0>, <matplotlib.axis.YTick object at 0x7fcb1bce1a60>, <matplotlib.axis.YTick object at 0x7fcb1bce0200>, <matplotlib.axis.YTick object at 0x7fca47b24530>]
[<matplotlib.axis.YTick object at 0x7f460836ccb0>, <matplotlib.axis.YTick object at 0x7f460836e660>, <matplotlib.axis.YTick object at 0x7f4530966d50>, <matplotlib.axis.YTick object at 0x7f4607b628d0>, <matplotlib.axis.YTick object at 0x7f4607bc2f00>, <matplotlib.axis.YTick object at 0x7f4607b63350>, <matplotlib.axis.YTick object at 0x7f4607b60ce0>, <matplotlib.axis.YTick object at 0x7f4607b62570>, <matplotlib.axis.YTick object at 0x7f4607b60a10>, <matplotlib.axis.YTick object at 0x7f4607b61c40>]
Expand Down Expand Up @@ -287,7 +287,7 @@ estimate the importance of the features.

.. code-block:: none
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/joblib/externals/loky/process_executor.py:752: UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.
/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/site-packages/joblib/externals/loky/process_executor.py:752: UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.
warnings.warn(
Expand Down Expand Up @@ -422,16 +422,16 @@ the features.
.. code-block:: none
<matplotlib.legend.Legend object at 0x7fcb1a06dd00>
<matplotlib.legend.Legend object at 0x7f46083f33b0>
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 43.179 seconds)
**Total running time of the script:** (0 minutes 43.137 seconds)

**Estimated memory usage:** 621 MB
**Estimated memory usage:** 639 MB


.. _sphx_glr_download_auto_examples_plot_variable_importance_classif.py:
Expand Down
26 changes: 13 additions & 13 deletions docs/_sources/auto_examples/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**10:11.305** total execution time for 6 files **from auto_examples**:
**09:56.190** total execution time for 6 files **from auto_examples**:

.. container::

Expand All @@ -33,20 +33,20 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_auto_examples_plot_knockoff_aggregation.py` (``plot_knockoff_aggregation.py``)
- 05:45.456
- 808.7
- 05:36.077
- 823.4
* - :ref:`sphx_glr_auto_examples_plot_fmri_data_example.py` (``plot_fmri_data_example.py``)
- 01:22.801
- 3279.1
- 01:22.636
- 3315.7
* - :ref:`sphx_glr_auto_examples_plot_2D_simulation_example.py` (``plot_2D_simulation_example.py``)
- 01:07.791
- 710.0
- 01:03.434
- 722.0
* - :ref:`sphx_glr_auto_examples_plot_dcrt_example.py` (``plot_dcrt_example.py``)
- 01:03.192
- 640.2
- 01:02.836
- 658.4
* - :ref:`sphx_glr_auto_examples_plot_variable_importance_classif.py` (``plot_variable_importance_classif.py``)
- 00:43.179
- 620.6
- 00:43.137
- 638.9
* - :ref:`sphx_glr_auto_examples_plot_diabetes_variable_importance_example.py` (``plot_diabetes_variable_importance_example.py``)
- 00:08.885
- 624.9
- 00:08.070
- 643.3
Loading

0 comments on commit d269315

Please sign in to comment.