[ENH]: Introduce JuniferConnectivityMeasure #348

Merged
synchon merged 10 commits from feat/junifer-connectivity-measure into main 2024-07-19 10:08:21 +00:00
synchon commented 2024-06-14 10:17:08 +00:00 (Migrated from github.com)
  • description of feature/fix
  • tests added/passed
  • add an entry for the latest changes

This PR introduces JuniferConnectivityMeasure, tailored nilearn.connectome.ConnectivityMeasure for junifer. This sets sklearn.covariance.EmpiricalCovariance as the default covariance estimator and correlation as the default connectivity matrix kind, which is what junifer users mostly do. It also sets the ground to add custom connectivity matrix kinds and correlation metrics. Required by #333 and #335 as of now.

* [x] description of feature/fix * [x] tests added/passed * [x] add an entry for the latest changes This PR introduces `JuniferConnectivityMeasure`, tailored `nilearn.connectome.ConnectivityMeasure` for junifer. This sets `sklearn.covariance.EmpiricalCovariance` as the default covariance estimator and `correlation` as the default connectivity matrix kind, which is what junifer users mostly do. It also sets the ground to add custom connectivity matrix kinds and correlation metrics. Required by #333 and #335 as of now.
codecov[bot] commented 2024-06-14 10:18:00 +00:00 (Migrated from github.com)

Codecov Report

Attention: Patch coverage is 93.38843% with 8 lines in your changes missing coverage. Please review.

Project coverage is 88.67%. Comparing base (f80c685) to head (6b792b9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #348      +/-   ##
==========================================
+ Coverage   88.58%   88.67%   +0.08%     
==========================================
  Files         114      115       +1     
  Lines        5028     5138     +110     
  Branches      983     1019      +36     
==========================================
+ Hits         4454     4556     +102     
- Misses        418      422       +4     
- Partials      156      160       +4     
Flag Coverage Δ
docs 100.00% <ø> (ø)
junifer 88.67% <93.38%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
docs/conf.py 100.00% <ø> (ø)
junifer/external/nilearn/__init__.py 100.00% <100.00%> (ø)
...ivity/crossparcellation_functional_connectivity.py 100.00% <100.00%> (ø)
...nnectivity/edge_functional_connectivity_parcels.py 100.00% <ø> (ø)
...nnectivity/edge_functional_connectivity_spheres.py 89.47% <ø> (ø)
...ional_connectivity/functional_connectivity_base.py 96.42% <100.00%> (+0.13%) ⬆️
...al_connectivity/functional_connectivity_parcels.py 100.00% <ø> (ø)
...al_connectivity/functional_connectivity_spheres.py 100.00% <ø> (ø)
...r/external/nilearn/junifer_connectivity_measure.py 92.52% <92.52%> (ø)
## [Codecov](https://app.codecov.io/gh/juaml/junifer/pull/348?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report Attention: Patch coverage is `93.38843%` with `8 lines` in your changes missing coverage. Please review. > Project coverage is 88.67%. Comparing base [(`f80c685`)](https://app.codecov.io/gh/juaml/junifer/commit/f80c68541bd3d9ba846808d73a920a6104060e62?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) to head [(`6b792b9`)](https://app.codecov.io/gh/juaml/junifer/commit/6b792b94d1603d3822c00a8d825f92db07a54d3a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml). <details><summary>Additional details and impacted files</summary> [![Impacted file tree graph](https://app.codecov.io/gh/juaml/junifer/pull/348/graphs/tree.svg?width=650&height=150&src=pr&token=5H21JuZXMw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #348 +/- ## ========================================== + Coverage 88.58% 88.67% +0.08% ========================================== Files 114 115 +1 Lines 5028 5138 +110 Branches 983 1019 +36 ========================================== + Hits 4454 4556 +102 - Misses 418 422 +4 - Partials 156 160 +4 ``` | [Flag](https://app.codecov.io/gh/juaml/junifer/pull/348/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs](https://app.codecov.io/gh/juaml/junifer/pull/348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `100.00% <ø> (ø)` | | | [junifer](https://app.codecov.io/gh/juaml/junifer/pull/348/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | `88.67% <93.38%> (+0.08%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/juaml/junifer/pull/348?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [docs/conf.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=docs%2Fconf.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-ZG9jcy9jb25mLnB5) | `100.00% <ø> (ø)` | | | [junifer/external/nilearn/\_\_init\_\_.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fexternal%2Fnilearn%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9leHRlcm5hbC9uaWxlYXJuL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [...ivity/crossparcellation\_functional\_connectivity.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fmarkers%2Ffunctional_connectivity%2Fcrossparcellation_functional_connectivity.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2Nyb3NzcGFyY2VsbGF0aW9uX2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5LnB5) | `100.00% <100.00%> (ø)` | | | [...nnectivity/edge\_functional\_connectivity\_parcels.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fmarkers%2Ffunctional_connectivity%2Fedge_functional_connectivity_parcels.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2VkZ2VfZnVuY3Rpb25hbF9jb25uZWN0aXZpdHlfcGFyY2Vscy5weQ==) | `100.00% <ø> (ø)` | | | [...nnectivity/edge\_functional\_connectivity\_spheres.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fmarkers%2Ffunctional_connectivity%2Fedge_functional_connectivity_spheres.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2VkZ2VfZnVuY3Rpb25hbF9jb25uZWN0aXZpdHlfc3BoZXJlcy5weQ==) | `89.47% <ø> (ø)` | | | [...ional\_connectivity/functional\_connectivity\_base.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fmarkers%2Ffunctional_connectivity%2Ffunctional_connectivity_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5X2Jhc2UucHk=) | `96.42% <100.00%> (+0.13%)` | :arrow_up: | | [...al\_connectivity/functional\_connectivity\_parcels.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fmarkers%2Ffunctional_connectivity%2Ffunctional_connectivity_parcels.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5X3BhcmNlbHMucHk=) | `100.00% <ø> (ø)` | | | [...al\_connectivity/functional\_connectivity\_spheres.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fmarkers%2Ffunctional_connectivity%2Ffunctional_connectivity_spheres.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9tYXJrZXJzL2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5L2Z1bmN0aW9uYWxfY29ubmVjdGl2aXR5X3NwaGVyZXMucHk=) | `100.00% <ø> (ø)` | | | [...r/external/nilearn/junifer\_connectivity\_measure.py](https://app.codecov.io/gh/juaml/junifer/pull/348?src=pr&el=tree&filepath=junifer%2Fexternal%2Fnilearn%2Fjunifer_connectivity_measure.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9leHRlcm5hbC9uaWxlYXJuL2p1bmlmZXJfY29ubmVjdGl2aXR5X21lYXN1cmUucHk=) | `92.52% <92.52%> (ø)` | | </details>
github-actions[bot] commented 2024-06-14 10:39:02 +00:00 (Migrated from github.com)
PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-07-19 10:27 UTC
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) v1.4.7 :---: Preview removed because the pull request was closed. 2024-07-19 10:27 UTC <!-- Sticky Pull Request Commentpr-preview -->
fraimondo (Migrated from github.com) approved these changes 2024-07-17 09:51:07 +00:00
fraimondo (Migrated from github.com) left a comment

This will require a new major I think.

This will require a new major I think.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer!348
No description provided.