joy50706 / iAMPCN

11 stars 5 forks source link

All the 10-cv function predictions only use the first model of ten folds ! #4

Open Sweetsour-crap opened 2 weeks ago

Sweetsour-crap commented 2 weeks ago

The users of the script predict.py should pay attention. In https://github.com/joy50706/iAMPCN/blob/master/predict.py#L145-150:

model_file=f'models/AMP_2nd/{function_name}/textcnn_cdhit_100_0.pth.tar'

It should be changed into

for cv_number in range(10):
  testing(testfasta=fas_seq,
  model_file=f'models/AMP_2nd/{function_name}/textcnn_cdhit_100_{cv_number}.pth.tar',
  save_file=f'tmp_save/{function_name}/{temp_save_AMP_filename}_{cv_number}.csv',
  batch_size=batch_size, patience=10, n_epochs=epochs,seq_len=seq_len,cdhit_value=cdhit_value,cv_number=cv_number)

Otherwise, the input data will only be predicted by the first model of the ten folds, and get the same probabilities in all folds.

I guess it should be a mistake by the users, please fix it.

Other users also noticed that #3, but it has not been fixed yet.

joy50706 commented 2 weeks ago

yes, you are right.