This folder contains the code for Causal Inference on Recommender Systems (Wang et al., 2020):
-
the empirical study on simulated datasets (Section 3.2)
-
the empirical study on random test sets (Section 3.3)
python 2
tensorflow 1.5.0
edward 1.3.5
Download the Yahoo R3 dataset and the coat dataset to dat/raw/
-
Yahoo R3: https://webscope.sandbox.yahoo.com/catalog.php?datatype=r
-
Coat (Schnabel et al., 2016): https://www.cs.cornell.edu/~schnabts/mnar/
Run the script src/preproc/prep_R3_weakgen.py
and
src/preproc/prep_R3_stronggen.py
to preprocess the dataset.
Run the script src/preproc/prep_coat_weakgen.py
and
src/preproc/prep_coat_stronggen.py
to preprocess the dataset.
Run the script src/simdat/simulate_generic.py
to simulate the
datasets.
Run the script src/preproc/prep_simulate_weakgen.py
and
src/preproc/prep_simulate_stronggen.py
to preprocess the dataset.
Run the script src/causalrec/run_sweep_R3_fitA.sh
and then
src/causalrec/run_sweep_R3.sh
to perform recommendation.
Run the script src/causalrec/run_sweep_coat_fitA.sh
and then
src/causalrec/run_sweep_coat.sh
to perform recommendation.
Run the script src/causalrec/run_sweep_simulation_fitA.sh
and then
src/causalrec/run_sweep_simulation.sh
to perform recommendation.
Run the script src/causalrec/merge_csv.py
to aggregate results.
The files res/*_allres.csv
include output from this implementation.
Y. Wang, D. Liang, L. Charlin, and D.M. Blei. (2020) Causal inference on recommender systems. Proceedings of the 14th ACM Conference on Recommender Systems.
Tobias Schnabel, Adith Swaminathan, Ashudeep Singh, Navin Chandak, Thorsten Joachims (2016). Recommendations as Treatments: Debiasing Learning and Evaluation. Proceedings of The International Conference on Machine Learning (ICML).