Skip to content

Commit

Permalink
Merge pull request #212 from amarquand/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
amarquand authored Jun 14, 2024
2 parents e7ebb95 + d073ae7 commit 131bea0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions pcntoolkit/normative.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,17 +852,15 @@ def predict(covfile, respfile, maskfile=None, **kwargs):
S2[:, i] = s2.squeeze()
if respfile is not None:
if alg == 'hbr':
# Z scores for HBR must be computed independently for each model
Z[:,i] = nm.get_mcmc_zscores(Xz, Yz[:, i:i+1], **kwargs)
else:
Z[:,i] = (Y[:, i] - Yhat[:, i]) / np.sqrt(S2[:, i])


if respfile is None:
save_results(None, Yhat, S2, None, outputsuffix=outputsuffix)

return (Yhat, S2)

else:
Y, maskvol = load_response_vars(respfile, maskfile)
if models is not None and len(Y.shape) > 1:
Y = Y[:, models]
if meta_data:
Expand Down Expand Up @@ -893,6 +891,10 @@ def predict(covfile, respfile, maskfile=None, **kwargs):
Y = Yw
else:
warp = False

if alg != 'hbr':
# For HBR the Z scores are already computed
Z = (Y - Yhat) / np.sqrt(S2)

print("Evaluating the model ...")
if meta_data and not warp:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def parse_requirements(filename):
# version = '0.29-1'

setup(name='pcntoolkit',
version='0.30-1',
version='0.30-2',
description='Predictive Clinical Neuroscience toolkit',
url='http://github.com/amarquand/PCNtoolkit',
author='Andre Marquand',
Expand Down

0 comments on commit 131bea0

Please sign in to comment.