junifer 0.0.6.dev11__py3-none-any.whl → 0.0.6.dev19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- junifer/_version.py +2 -2
- junifer/external/nilearn/junifer_connectivity_measure.py +23 -15
- junifer/external/nilearn/tests/test_junifer_connectivity_measure.py +1 -0
- {junifer-0.0.6.dev11.dist-info → junifer-0.0.6.dev19.dist-info}/METADATA +1 -1
- {junifer-0.0.6.dev11.dist-info → junifer-0.0.6.dev19.dist-info}/RECORD +10 -10
- {junifer-0.0.6.dev11.dist-info → junifer-0.0.6.dev19.dist-info}/AUTHORS.rst +0 -0
- {junifer-0.0.6.dev11.dist-info → junifer-0.0.6.dev19.dist-info}/LICENSE.md +0 -0
- {junifer-0.0.6.dev11.dist-info → junifer-0.0.6.dev19.dist-info}/WHEEL +0 -0
- {junifer-0.0.6.dev11.dist-info → junifer-0.0.6.dev19.dist-info}/entry_points.txt +0 -0
- {junifer-0.0.6.dev11.dist-info → junifer-0.0.6.dev19.dist-info}/top_level.txt +0 -0
junifer/_version.py
CHANGED
@@ -12,5 +12,5 @@ __version__: str
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
13
13
|
version_tuple: VERSION_TUPLE
|
14
14
|
|
15
|
-
__version__ = version = '0.0.6.
|
16
|
-
__version_tuple__ = version_tuple = (0, 0, 6, '
|
15
|
+
__version__ = version = '0.0.6.dev19'
|
16
|
+
__version_tuple__ = version_tuple = (0, 0, 6, 'dev19')
|
@@ -13,7 +13,7 @@ from nilearn.connectome import (
|
|
13
13
|
prec_to_partial,
|
14
14
|
sym_matrix_to_vec,
|
15
15
|
)
|
16
|
-
from scipy import linalg
|
16
|
+
from scipy import linalg, stats
|
17
17
|
from sklearn.base import clone
|
18
18
|
from sklearn.covariance import EmpiricalCovariance
|
19
19
|
|
@@ -314,15 +314,18 @@ class JuniferConnectivityMeasure(ConnectivityMeasure):
|
|
314
314
|
* default ``cov_estimator`` is
|
315
315
|
:class:`sklearn.covariance.EmpiricalCovariance`
|
316
316
|
* default ``kind`` is ``"correlation"``
|
317
|
+
* supports Spearman's correlation via ``kind="spearman correlation"``
|
317
318
|
|
318
319
|
Parameters
|
319
320
|
----------
|
320
321
|
cov_estimator : estimator object, optional
|
321
322
|
The covariance estimator
|
322
323
|
(default ``EmpiricalCovariance(store_precision=False)``).
|
323
|
-
kind : {"covariance", "correlation", "
|
324
|
-
"tangent", "precision"}, optional
|
325
|
-
The matrix kind.
|
324
|
+
kind : {"covariance", "correlation", "spearman correlation", \
|
325
|
+
"partial correlation", "tangent", "precision"}, optional
|
326
|
+
The matrix kind. The default value uses Pearson's correlation.
|
327
|
+
If ``"spearman correlation"`` is used, the data will be ranked before
|
328
|
+
estimating the covariance. For the use of ``"tangent"`` see [1]_
|
326
329
|
(default "correlation").
|
327
330
|
vectorize : bool, optional
|
328
331
|
If True, connectivity matrices are reshaped into 1D arrays and only
|
@@ -400,17 +403,22 @@ class JuniferConnectivityMeasure(ConnectivityMeasure):
|
|
400
403
|
self.cov_estimator_ = clone(self.cov_estimator)
|
401
404
|
|
402
405
|
# Compute all the matrices, stored in "connectivities"
|
403
|
-
if self.kind
|
404
|
-
covariances_std = [
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
406
|
+
if self.kind in ["correlation", "spearman correlation"]:
|
407
|
+
covariances_std = []
|
408
|
+
for x in X:
|
409
|
+
x = signal.standardize_signal(
|
410
|
+
x,
|
411
|
+
detrend=False,
|
412
|
+
standardize=self.standardize,
|
413
|
+
)
|
414
|
+
|
415
|
+
# rank data if spearman correlation
|
416
|
+
# before calculating covariance
|
417
|
+
if self.kind == "spearman correlation":
|
418
|
+
x = stats.rankdata(x, axis=0)
|
419
|
+
|
420
|
+
covariances_std.append(self.cov_estimator_.fit(x).covariance_)
|
421
|
+
|
414
422
|
connectivities = [cov_to_corr(cov) for cov in covariances_std]
|
415
423
|
else:
|
416
424
|
covariances = [self.cov_estimator_.fit(x).covariance_ for x in X]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: junifer
|
3
|
-
Version: 0.0.6.
|
3
|
+
Version: 0.0.6.dev19
|
4
4
|
Summary: JUelich NeuroImaging FEature extractoR
|
5
5
|
Author-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>
|
6
6
|
Maintainer-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
junifer/__init__.py,sha256=-T9XmiCCL0j3YLx-0Pph15sPfL5FlcBDscajjJ-V4sU,604
|
2
|
-
junifer/_version.py,sha256=
|
2
|
+
junifer/_version.py,sha256=wZWyCHAcc7iLZxm5FymgJmboZgMFn19f87418KPqxDg,426
|
3
3
|
junifer/stats.py,sha256=BjQb2lfTGDP9l4UuQYmJFcJJNRfbJDGlNvC06SJaDDE,6237
|
4
4
|
junifer/api/__init__.py,sha256=lwyIF0hPc7fICuSoddJfay0LPqlTRxHJ_xbtizgFYZA,312
|
5
5
|
junifer/api/cli.py,sha256=53pews3mXkJ7DUDSkV51PbitYnuVAdQRkWG-gjO08Uw,16142
|
@@ -134,9 +134,9 @@ junifer/external/h5io/h5io/_version.py,sha256=mFY0GwwuN-a3M8w93_mskS6GZIvv9SNdjL
|
|
134
134
|
junifer/external/h5io/h5io/chunked_array.py,sha256=K1HWf7R2Jc7gCzBqAoBjx0ZnMmUhTe3iAO6RF6PdUO4,3338
|
135
135
|
junifer/external/h5io/h5io/chunked_list.py,sha256=1Y5BbuWzurJlEFQzJNuDdC3fNZ39ENEMba99X_4VeSM,1952
|
136
136
|
junifer/external/nilearn/__init__.py,sha256=UdUKYArx3hvcziln89iaSGZcNGwHvsmbB4E5gS1zvOs,321
|
137
|
-
junifer/external/nilearn/junifer_connectivity_measure.py,sha256=
|
137
|
+
junifer/external/nilearn/junifer_connectivity_measure.py,sha256=c8aLIlSs2eo6uHj-ZtYAto4szjbj21Zlj5JTQRrAnu8,17322
|
138
138
|
junifer/external/nilearn/junifer_nifti_spheres_masker.py,sha256=DbSK2hKrgpHZ_vCRLbVv3YJpLZNkEAG0HFfQQpG6zdU,16546
|
139
|
-
junifer/external/nilearn/tests/test_junifer_connectivity_measure.py,sha256=
|
139
|
+
junifer/external/nilearn/tests/test_junifer_connectivity_measure.py,sha256=yBsi9g_31UDo_oG7K6eKRp36CZ28G5cbNcKM3aTT53s,33946
|
140
140
|
junifer/external/nilearn/tests/test_junifer_nifti_spheres_masker.py,sha256=zpvBYIvaNjUj9fIUg5K78LRzJqbyMYlUo2UQYS9_lo4,12275
|
141
141
|
junifer/markers/__init__.py,sha256=u4BFgS_3GXAwFN2HfqdAhlBkyenLw4IYlMlwXwnjkVQ,1235
|
142
142
|
junifer/markers/base.py,sha256=__Z0owDdjTwb7alQneOeoaUqaeCVbHwFRnaRZERi37M,8364
|
@@ -267,10 +267,10 @@ junifer/utils/logging.py,sha256=ardaiJkDfZMYvak5UIL5Etxg5Ii7inmVQSBdFLdgtb8,9781
|
|
267
267
|
junifer/utils/tests/test_fs.py,sha256=WQS7cKlKEZ742CIuiOYYpueeAhY9PqlastfDVpVVtvE,923
|
268
268
|
junifer/utils/tests/test_helpers.py,sha256=k5qqfxK8dFyuewTJyR1Qn6-nFaYNuVr0ysc18bfPjyU,929
|
269
269
|
junifer/utils/tests/test_logging.py,sha256=duO4ou365hxwa_kwihFtKPLaL6LC5XHiyhOijrrngbA,8009
|
270
|
-
junifer-0.0.6.
|
271
|
-
junifer-0.0.6.
|
272
|
-
junifer-0.0.6.
|
273
|
-
junifer-0.0.6.
|
274
|
-
junifer-0.0.6.
|
275
|
-
junifer-0.0.6.
|
276
|
-
junifer-0.0.6.
|
270
|
+
junifer-0.0.6.dev19.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
|
271
|
+
junifer-0.0.6.dev19.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
|
272
|
+
junifer-0.0.6.dev19.dist-info/METADATA,sha256=Fqi240THeyTkrkoQLR87j1ybgjdR-_m5DMeWgy1JTHc,8279
|
273
|
+
junifer-0.0.6.dev19.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
274
|
+
junifer-0.0.6.dev19.dist-info/entry_points.txt,sha256=DxFvKq0pOqRunAK0FxwJcoDfV1-dZvsFDpD5HRqSDhw,48
|
275
|
+
junifer-0.0.6.dev19.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
|
276
|
+
junifer-0.0.6.dev19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|