CDDLeiden / QSPRpred

A tool for creating Quantitative Structure Property/Activity Relationship (QSPR/QSAR) models.
https://cddleiden.github.io/QSPRpred/docs/
MIT License
43 stars 7 forks source link

problem with XGB #2

Closed zemanet2020 closed 1 year ago

zemanet2020 commented 1 year ago

I'm running QSPRPred in anaconda environment with python 3.9. I tried to run the following command sequentially and got an error at the end. I think data_CLI and model_CLI ran OK but pred_CLI had a problem.

$ python -m qsprpred.data_CLI -i parkinsons_pivot.tsv -pr GABAAalpha -r true -sf 0.15 -fe Morgan $ python -m qsprpred.model_CLI -pr GABAAalpha -r REG -me -s -m XGB $ python -m qsprpred.predict_CLI -i parkinsons_pivot.tsv -pr GABAAalpha -r REG -m XGB { "base_dir": ".", "debug": false, "random_state": 1, "input": "parkinsons_pivot.tsv", "output": "predictions", "ncpu": 8, "gpus": [ "0" ], "smilescol": "SMILES", "properties": [ [ "GABAAalpha" ] ], "regression": [ true ], "model_types": [ "XGB" ], "no_preprocessing": false, "no_git": false } XGB

Traceback (most recent call last): File "/opt/anaconda/envs/drugex/lib/python3.9/site-packages/qsprpred/predict_CLI.py", line 184, in QSPR_predict(args) File "/opt/anaconda/envs/drugex/lib/python3.9/site-packages/qsprpred/predict_CLI.py", line 134, in QSPR_predict predictions = predictor.predictMols(smiles_list) File "/opt/anaconda/envs/drugex/lib/python3.9/site-packages/qsprpred/models/interfaces.py", line 490, in predictMols predictions = self.predict(dataset) File "/opt/anaconda/envs/drugex/lib/python3.9/site-packages/qsprpred/models/models.py", line 302, in predict return self.model.predict(X) File "/opt/anaconda/envs/drugex/lib/python3.9/site-packages/xgboost/sklearn.py", line 601, in predict return self.get_booster().predict(test_dmatrix, File "/opt/anaconda/envs/drugex/lib/python3.9/site-packages/xgboost/sklearn.py", line 271, in get_booster raise XGBoostError('need to call fit or load_model beforehand') xgboost.core.XGBoostError: need to call fit or load_model beforehand

martin-sicho commented 1 year ago

Hi, seems like the trained model perhaps did not save properly. Can you confirm this is still the case in the latest development version? Installation like this:

pip install git+https://github.com/CDDLeiden/QSPRPred.git@v2.0.0.dev1

Again, very sorry for the late reply.

martin-sicho commented 1 year ago

Closed for inactivity. Let us know if you still need help.