Closed hannahhacker closed 3 months ago
I'll look into this (related to #47 ) and should have it fixed by the end of the day today.
Thank you so much!
@hannahhacker Please try running your code with the latest dev version. You'll need to upgrade the package to 2.4.5
:
pip install git+https://github.com/rpomponio/neuroHarmonize --upgrade
If this works I will distribute again on the Packaging Index.
It worked now! Thank you so much!
Hi, thank you so much for this package. I´m Hannah, a Master´s student and I am trying to train the model on healthy participants (n=376) and then apply it to my patient groups (n=695). Is it a problem that I have a different number of cases in the train and the test sample? Because I am, getting this error when I try to apply the trained model to the holdout data:
Cell In[25], line 5 my_holdout_data_adj = harmonizationApply(grad1_pat_combat, covars, my_model)
File ~\AppData\Local\anaconda3\envs\tvb\lib\site-packages\neuroHarmonize\harmonizationApply.py:100 in harmonizationApply s_data, stand_mean, var_pooled, mod_mean = applyStandardizationAcrossFeatures(data, design, info_dict, model)
File ~\AppData\Local\anaconda3\envs\tvb\lib\site-packages\neuroHarmonize\harmonizationApply.py:141 in applyStandardizationAcrossFeatures s_data = ((X- stand_mean - mod_mean) / np.dot(np.sqrt(var_pooled), np.ones((1, n_sample))))
ValueError: operands could not be broadcast together with shapes (1000,695) (1000,376)
Thank you for your help!