giacoballoccu / explanation-quality-recsys

Post Processing Explanations Paths in Path Reasoning Recommender Systems with Knowledge Graphs
GNU General Public License v2.0
29 stars 6 forks source link

Traceback (most recent call last): File "main.py", line 208, in <module> soft_optimization_ETD(path_data) File "E:\FengHanWen\explanation-quality-recsys-main\optimizations.py", line 42, in soft_optimization_ETD current_item_pred_paths = pred_path[uid][pid] KeyError: 919 #4

Open Pursuerwener opened 1 year ago

Pursuerwener commented 1 year ago

i have got the three datasets, the lastfm and ml1m in preprocessed_datasets.tar.gz put in explanation-quality-recsys-main/datasets the lastfm and ml1m in lastfmpaths ,ml1mpaths put in explanation-quality-recsys-main/paths the lastfm and ml1m in lastfmtmp,ml1mtmp put in explanation-quality-recsys-main/models/PGPR/tmp

after running python main.py --dataset=lastfm --opt=softETD i get the error Traceback (most recent call last): File "main.py", line 208, in soft_optimization_ETD(path_data) File "E:\FengHanWen\explanation-quality-recsys-main\optimizations.py", line 42, in soft_optimization_ETD current_item_pred_paths = pred_path[uid][pid] KeyError: 919

i change command --opt=softSEP/softLIR, but there is the same problem as above i can't get results

giacoballoccu commented 1 year ago

Hi Pursuerwener, Please check your pred_paths and if the dictionary is empty or not. You are getting key error on the pred_paths (which are outputted from the model saved and used in the optimizations) so what could be is 1) Pred path is empty for some reason 2) You are trying to get paths for a user who has not been predicted by the model (uid not in pred_paths) 3) The user exists in predict paths but the item is not there basically pid not in pred_paths[uid].

I would recommend you to check in which case you are and send me more information about it so I can reproduce the error and help you