pcntoolkit 0.30__tar.gz → 0.30.post2__tar.gz
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.
- {pcntoolkit-0.30/pcntoolkit.egg-info → pcntoolkit-0.30.post2}/PKG-INFO +1 -1
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative.py +17 -14
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2/pcntoolkit.egg-info}/PKG-INFO +1 -1
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/setup.py +1 -1
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/LICENSE +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/MANIFEST.in +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/README.md +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/__init__.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/configs.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/dataio/__init__.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/dataio/fileio.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/NP.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/NPR.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/SHASH.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/__init__.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/architecture.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/bayesreg.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/gp.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/hbr.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/model/rfa.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_NP.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/__init__.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/norm_base.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/norm_blr.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/norm_gpr.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/norm_hbr.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/norm_np.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/norm_rfa.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_model/norm_utils.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/normative_parallel.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/trendsurf.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/util/__init__.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/util/hbr_utils.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit/util/utils.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit.egg-info/SOURCES.txt +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit.egg-info/dependency_links.txt +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit.egg-info/not-zip-safe +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit.egg-info/requires.txt +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/pcntoolkit.egg-info/top_level.txt +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/requirements.txt +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/setup.cfg +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/testHBR.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/testHBR_transfer.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_NP.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_ST_NP.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_blr.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_gpr.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_hbr_pymc.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_normative.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_normative_parallel.py +0 -0
- {pcntoolkit-0.30 → pcntoolkit-0.30.post2}/tests/test_rand_feat.py +0 -0
|
@@ -800,7 +800,11 @@ def predict(covfile, respfile, maskfile=None, **kwargs):
|
|
|
800
800
|
X = fileio.load(covfile)
|
|
801
801
|
if len(X.shape) == 1:
|
|
802
802
|
X = X[:, np.newaxis]
|
|
803
|
-
|
|
803
|
+
if respfile is not None:
|
|
804
|
+
Y, maskvol = load_response_vars(respfile, maskfile)
|
|
805
|
+
if len(Y.shape) == 1:
|
|
806
|
+
Y = Y[:, np.newaxis]
|
|
807
|
+
|
|
804
808
|
sample_num = X.shape[0]
|
|
805
809
|
if models is not None:
|
|
806
810
|
feature_num = len(models)
|
|
@@ -817,6 +821,11 @@ def predict(covfile, respfile, maskfile=None, **kwargs):
|
|
|
817
821
|
Xz = scaler_cov[fold].transform(X)
|
|
818
822
|
else:
|
|
819
823
|
Xz = X
|
|
824
|
+
if respfile is not None:
|
|
825
|
+
if outscaler in ['standardize', 'minmax', 'robminmax']:
|
|
826
|
+
Yz = scaler_resp[fold].transform(Y)
|
|
827
|
+
else:
|
|
828
|
+
Yz = Y
|
|
820
829
|
|
|
821
830
|
# estimate the models for all variabels
|
|
822
831
|
for i, m in enumerate(models):
|
|
@@ -842,26 +851,16 @@ def predict(covfile, respfile, maskfile=None, **kwargs):
|
|
|
842
851
|
Yhat[:, i] = yhat.squeeze()
|
|
843
852
|
S2[:, i] = s2.squeeze()
|
|
844
853
|
if respfile is not None:
|
|
845
|
-
Y, maskvol = load_response_vars(respfile, maskfile)
|
|
846
|
-
Y = Y[:, i:i+1]
|
|
847
854
|
if alg == 'hbr':
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
else:
|
|
851
|
-
Yz = Y
|
|
852
|
-
Z[:,i] = nm.get_mcmc_zscores(Xz, Yz, **kwargs)
|
|
853
|
-
else:
|
|
854
|
-
Z[:,i] = (Y - Yhat[:, i]) / np.sqrt(S2[:, i])
|
|
855
|
-
|
|
855
|
+
# Z scores for HBR must be computed independently for each model
|
|
856
|
+
Z[:,i] = nm.get_mcmc_zscores(Xz, Yz[:, i:i+1], **kwargs)
|
|
856
857
|
|
|
857
|
-
|
|
858
858
|
if respfile is None:
|
|
859
859
|
save_results(None, Yhat, S2, None, outputsuffix=outputsuffix)
|
|
860
860
|
|
|
861
861
|
return (Yhat, S2)
|
|
862
|
-
|
|
862
|
+
|
|
863
863
|
else:
|
|
864
|
-
Y, maskvol = load_response_vars(respfile, maskfile)
|
|
865
864
|
if models is not None and len(Y.shape) > 1:
|
|
866
865
|
Y = Y[:, models]
|
|
867
866
|
if meta_data:
|
|
@@ -892,6 +891,10 @@ def predict(covfile, respfile, maskfile=None, **kwargs):
|
|
|
892
891
|
Y = Yw
|
|
893
892
|
else:
|
|
894
893
|
warp = False
|
|
894
|
+
|
|
895
|
+
if alg != 'hbr':
|
|
896
|
+
# For HBR the Z scores are already computed
|
|
897
|
+
Z = (Y - Yhat) / np.sqrt(S2)
|
|
895
898
|
|
|
896
899
|
print("Evaluating the model ...")
|
|
897
900
|
if meta_data and not warp:
|
|
@@ -14,7 +14,7 @@ requirements = parse_requirements('requirements.txt')
|
|
|
14
14
|
# version = '0.29-1'
|
|
15
15
|
|
|
16
16
|
setup(name='pcntoolkit',
|
|
17
|
-
version='0.30',
|
|
17
|
+
version='0.30-2',
|
|
18
18
|
description='Predictive Clinical Neuroscience toolkit',
|
|
19
19
|
url='http://github.com/amarquand/PCNtoolkit',
|
|
20
20
|
author='Andre Marquand',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|