This is the pytorch implementation of our paper at KDD 2021:
Deconfounded Recommendation for Alleviating Bias Amplification
Wenjie Wang, Fuli Feng, Xiangnan He, Xiang Wang, Tat-Seng Chua.
- Anaconda 3
- python 3.7.3
- pytorch 1.4.0
- numpy 1.16.4
The experimental data are in './data' folder, except 'item_feature_file.npy' of amazon_book. It is uploaded to Google drive:DecRS/data/amazon_book due to the large size.
python main.py --model=$1 --dataset=$2 --lr=$3 --batch_size=$4 --dropout=$5 --alpha=$6 --lamda=$7 --gpu=$8
or use run.sh
sh run.sh model dataset lr batch_size dropout alpha lamda gpu_id
- The log file will be in the './code/{dataset}/log/' folder.
- The explanation of hyper-parameters can be found in './code/{dataset}/main.py'.
- The default hyper-parameter settings are detailed in './code/{dataset}/hyper-parameters.txt'.
- Download the ranking scores released by us from Google drive:DecRS/ranking_scores/{dataset}/.
- Put four '.npy' file into the corresponding folder, i.e., './code/{dataset}/inference'.
- Get the results of DecRS over different user groups by running DecFM.py or DecNFM.py:
python DecFM.py
- Train DecFM on ML-1M:
cd ./code/ml-1m
sh run.sh DecFM ml_1m 0.05 1024 [0.3,0.3] 0.2 0.1 0
- Inference DecNFM on amazon_book
cd ./code/amazon-book/inference
python DecNFM.py
If you use our code or data, please kindly cite:
@inproceedings{wang2021deconfounding,
title={Deconfounded Recommendation for Alleviating Bias Amplification},
author={Wenjie Wang, Fuli Feng, Xiangnan He, Xiang Wang, and Tat-Seng Chua},
booktitle={KDD},
year={2021},
publisher={ACM}
}
Thanks to the FM/NFM implementation:
- NFM-torch from Yangyang Guo.
- NFM-tensorflow from Xiangnan He.
NUS © NExT++