anbai106 / mlni

Machine Learning in NeuroImaging (MLNI) is a python package that performs various tasks using neuroimaging data.
https://anbai106.github.io/mlni/
MIT License
8 stars 7 forks source link

Apply the trained model to unseen data. #7

Closed yh-zhu closed 4 months ago

yh-zhu commented 9 months ago

I want to use the trained model(final model) to predict unseen data. Is there a way to do it?

anbai106 commented 8 months ago

The software saved the trained model in a certain format. What you need to do is to read the saved model and apply the model to unseen data. We did not include this as a functionality because this is quite straightforward and depends on the user's choice.

yh-zhu commented 8 months ago

Thank you. I have tried to set the save_model option as True/False, but I have trouble to figure out which one is the final model.

When the 'save_model' option was set to False, it resulted in saving the last repetition, is this the final model(ex. svm-1_last_repetition.joblib )? When it was set to True, there were 100 models for each CV, was the cv_99 the final model?

I also tried to load the model to get a prediction for unseen data, however it did not give me the subtypes label, but only predicted the new data as PT(1).

anbai106 commented 4 months ago

Please see the added function at the end of the utils.py file:

apply_2_external_data_hydra