From b7c1793a1df39816bde69faa99535758456c225c Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 20 Jul 2023 08:20:12 +0200 Subject: [PATCH 1/5] update: bump julearn to 0.3.0 in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 93793da59..3c5267e0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,7 @@ docs = [ "sphinx-gallery>=0.11.0,<0.12", "furo>=2022.9.29,<2023.0.0", "numpydoc>=1.5.0,<1.6", - "julearn==0.2.5", + "julearn==0.3.0", "sphinx-copybutton==0.5.1", "towncrier==22.12.0", "sphinxcontrib-mermaid==0.8.1", -- 2.52.0 From d16ecdf31330da1d89c55fa71c2ed0620d0a71d5 Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 20 Jul 2023 11:00:34 +0200 Subject: [PATCH 2/5] update: adapt run_junifer_julearn.py --- examples/run_junifer_julearn.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/examples/run_junifer_julearn.py b/examples/run_junifer_julearn.py index aec3bbbaf..c1435b682 100644 --- a/examples/run_junifer_julearn.py +++ b/examples/run_junifer_julearn.py @@ -16,9 +16,9 @@ import tempfile import nilearn import pandas as pd -from julearn import run_cross_validation +from julearn import run_cross_validation, PipelineCreator -import junifer.testing.registry # noqa +import junifer.testing.registry # noqa: F401 from junifer.api import collect, run from junifer.storage.sqlite import SQLiteFeatureStorage from junifer.utils import configure_logging @@ -70,7 +70,6 @@ sex = ( ############################################################################### # Create a temporary directory for junifer feature extraction: with tempfile.TemporaryDirectory() as tmpdir: - storage = {"kind": "SQLiteFeatureStorage", "uri": f"{tmpdir}/test.sqlite"} # run the defined junifer feature extraction pipeline run( @@ -97,15 +96,23 @@ X = list(df_vbm.columns) df_vbm[y] = age df_vbm[confound] = sex +X_types = { + "features": X, + "confound": confound, +} + +creator = PipelineCreator(problem_type="regression", apply_to="features") +creator.add("zscore", apply_to=["features", "confound"]) +creator.add("confound_removal", apply_to="features", confounds="confound") +creator.add("ridge") + scores = run_cross_validation( - X=X, - confounds=confound, + X=X + [confound], y=y, + X_types=X_types, data=df_vbm, - problem_type="regression", - model="ridge", + model=creator, cv=3, - preprocess_X=["zscore", "remove_confound"], ) print(scores) -- 2.52.0 From 04f094a1b55dad8b43966d57040d76f71a78a82d Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 20 Jul 2023 11:05:05 +0200 Subject: [PATCH 3/5] chore: add changelog 242.doc --- docs/changes/newsfragments/242.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/newsfragments/242.doc diff --git a/docs/changes/newsfragments/242.doc b/docs/changes/newsfragments/242.doc new file mode 100644 index 000000000..0fab06f7a --- /dev/null +++ b/docs/changes/newsfragments/242.doc @@ -0,0 +1 @@ +Update ``julearn`` example under ``examples`` by `Synchon Mandal`_ -- 2.52.0 From 57e00de06149834aceb837e3487b96ae727fef97 Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 20 Jul 2023 12:41:56 +0200 Subject: [PATCH 4/5] chore: add nitpick ignore entry for weird nilearn reference in sphinx --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index c17459636..04c5a5b60 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -81,6 +81,7 @@ nitpick_ignore_regex = [ ("py:class", "typing.Any"), # python 3.11 error # ('py:class', 'numpy.typing.ArrayLike') ("py:obj", "sqlalchemy.engine.Engine"), # ignore sqlalchemy + ("py:class", "pipeline.Pipeline"), # nilearn ] # -- Options for HTML output ------------------------------------------------- -- 2.52.0 From 73cfa7cbed9082533fdb729b78ba69b43886a6ac Mon Sep 17 00:00:00 2001 From: Synchon Mandal Date: Thu, 20 Jul 2023 12:42:36 +0200 Subject: [PATCH 5/5] chore: update docs makefile --- docs/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Makefile b/docs/Makefile index 8ad9ee70a..6bdee39ec 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,6 +17,7 @@ help: clean: rm -rf $(BUILDDIR)/* rm -rf auto_examples/ + rm -rf api/generated/ # For local build local: news -- 2.52.0