This repository contains the source codes and datasets of the paper AMORe: An Agnostic Multi-Objective Framework for Recommendation.
We implemented and tested the models in Python 3.8.10, with PyTorch==2.0.1 and CUDA 11.7. The NGCF model require PyTorch Geometric. Then, the requirements listed in the requirements.txt file refer to these versions. You may create the virtual environment with the requirements file as follows:
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install --upgrade pip
$ pip install -r requirements.txt
In the folder data, you can find the data used in our work (Amazon Baby, Facebook Books, Amazon Music). We provide the split version of the data.
In the following, we explain how to run the models within the paper.
- BPRMF, NGCF, MultiFR, and AMORe can be executed through the
main.pyscript. Specifically, you should refer to the configuration files contained into the folderconfig_files. You may train the model by running the following code:The configuration files are in the folder$ CUBLAS_WORKSPACE_CONFIG=:4096:8 python3 -u main.py --config [CONFIGURATION_FILE_NAME]config_files. Consider the following schema:_dataset_backbone_none.ymlas the configuration files for vanilla backbone by changingdatasetandbackboneat you convenience._dataset_backbone_AMORE_SCALE_cp.ymlas the configuration files for AMORe with static scalarization by changingdatasetandbackboneat you convenience._dataset_backbone_AMORE_MGDA_cp.ymlas the configuration files for AMORe with MGDA by changingdatasetandbackboneat you convenience._dataset_backbone_AMORE_EPO_cp.ymlas the configuration files for AMORe with EPO by changingdatasetandbackboneat you convenience._dataset_backbone_multifr_cp.ymlas the configuration files for MultiFR.
- CPFAIR can be executed through the
main_cpfair.pyscript. It requires the matrix of scores (user, item) predicted by a backbone model (in this paper BPRMF and NGCF). For this reason, this code is prepared in order to load such matrix saved with.npzextension from a folder calledarrays. You may train the model by running the following code:Please, note that to execute this baseline, you need to install the Gurobi package on your machine.$ python3 -u main_cpfair.py
To evaluate the models, we relied on the public and open-source framework Elliot. Here, given a pre-obtained recommendation list by running the models as explained above, you can compute the metrics discussed within the paper. Please, refer to Elliot official documentation for further details on how compute the metrics. We add an example of configuration file in the config_files folder within the compressed file.