ddiem-ri-4D / epiTCR

epiTCR: a highly sensitive predictor for TCR–peptide binding
https://github.com/ddiem-ri-4D/epiTCR
MIT License
8 stars 5 forks source link

error in predict.py #3

Open nbahlis opened 1 year ago

nbahlis commented 1 year ago

Hello

thank you for the great tool. I am getting the error below when I run the predict.py What am I doing wrong ?

Traceback (most recent call last): File "predict.py", line 37, in auc_test, acc_test, sens_test, spec_test = Model.predicMLModel(model_rf, test, pX_test, py_test, args.outfile) File "/epiTCR-main/src/modules/model.py", line 78, in predicMLModel y_rf_test_proba = model.predict_proba(X_test) File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/ensemble/_forest.py", line 865, in predict_proba X = self._validate_X_predict(X) File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/ensemble/_forest.py", line 599, in _validate_X_predict X = self._validate_data(X, dtype=DTYPE, accept_sparse="csr", reset=False) File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py", line 579, in _validate_data self._check_feature_names(X, reset=reset) File "/opt/anaconda3/lib/python3.8/site-packages/sklearn/base.py", line 506, in _check_feature_names raise ValueError(message) ValueError: The feature names should match those that were passed during fit. Feature names seen at fit time, yet now missing:

ddiem-ri-4D commented 1 year ago

Hi nbahlis,

Thank you for your effort in running the code with this repository.

I understand that you selected --chain ce but used --modelfile models/rdforestWithMHCModel.pickle instead. To correct this, please change it to --modelfile models/rdforestWithoutMHCModel.pickle --chain ce because --chain ce is intended for models without MHC information. The correct combinations of arguments are: --modelfile models/rdforestWithoutMHCModel.pickle --chain ce and --modelfile models/rdforestWithMHCModel.pickle --chain cem.

Thank you very much for your attention.

Best regards,

Mỹ Diễm