Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to load SPARE-* model #24

Merged
merged 5 commits into from
Sep 9, 2021
Merged

Add ability to load SPARE-* model #24

merged 5 commits into from
Sep 9, 2021

Conversation

AbdulkadirA
Copy link
Contributor

No description provided.

iSTAGING/datamodel.py Outdated Show resolved Hide resolved
@AbdulkadirA AbdulkadirA marked this pull request as ready for review July 15, 2021 17:17
Copy link
Contributor

@ashishsingh18 ashishsingh18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments.

The application itself crashes for me with below message.

python -m iSTAGING.main --data_file D:\ashish\Data\iSTAGINGData\withsparescores\istaging.pkl.gz --harmonization_model_file D:\ashish\Data\iSTAGINGData\MUSE_harmonization_model.pkl --SPARE_model_file D:\ashish\Data\iSTAGINGData\SPARE_model_LIN-SVM_single_MUSE_ROIs_RES.pkl.gz
D:\ashish\Installs\Python\iStagingENV\lib\site-packages\sklearn\base.py:310: UserWarning: Trying to unpickle estimator StandardScaler from version 0.24.2 when using version 0.24.1. This might lead to breaking code or invalid results. Use at your own risk.
warnings.warn(
D:\ashish\Installs\Python\iStagingENV\lib\site-packages\sklearn\base.py:310: UserWarning: Trying to unpickle estimator SVR from version 0.24.2 when using version 0.24.1. This might lead to breaking code or invalid results. Use at your own risk.
warnings.warn(
D:\ashish\Installs\Python\iStagingENV\lib\site-packages\sklearn\base.py:310: UserWarning: Trying to unpickle estimator SVC from version 0.24.2 when using version 0.24.1. This might lead to breaking code or invalid results. Use at your own risk.
warnings.warn(
setting SPARE models
Running harmonization.
Harmonization done.
Pooled variance: 1476.461182
Computing SPARE-*.
Traceback (most recent call last):
File "D:\ashish\Installs\Python\iStagingENV\lib\site-packages\pandas\core\indexes\base.py", line 3080, in get_loc
return self._engine.get_loc(casted_key)
File "pandas_libs\index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'RES_ICV_Sex_MUSE_Volume_4'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\mainwindow.py", line 425, in OnProcessSpareClicked
self.model.SetData(p.DoSPARE(self.model.GetCompleteData(),
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\processes.py", line 66, in DoSPARE
y_hat = predictAD(data, ADModel)
File "D:\ashish\work\projects\iSTAGING-Tools\iSTAGING\processes.py", line 39, in predictAD
idx = ~data[model['predictors'][0]].isnull()
File "D:\ashish\Installs\Python\iStagingENV\lib\site-packages\pandas\core\frame.py", line 3024, in getitem
indexer = self.columns.get_loc(key)
File "D:\ashish\Installs\Python\iStagingENV\lib\site-packages\pandas\core\indexes\base.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: 'RES_ICV_Sex_MUSE_Volume_4'

iSTAGING/dataio.py Outdated Show resolved Hide resolved
iSTAGING/datamodel.py Show resolved Hide resolved
iSTAGING/mainwindow.py Outdated Show resolved Hide resolved
iSTAGING/mainwindow.py Outdated Show resolved Hide resolved
iSTAGING/processes.py Outdated Show resolved Hide resolved
iSTAGING/processes.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ashishsingh18 ashishsingh18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@AbdulkadirA AbdulkadirA merged commit dc8fb56 into CBICA:main Sep 9, 2021
@AbdulkadirA AbdulkadirA deleted the SPARE-model branch December 1, 2021 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants