Skip to content

YuanchenBei/ColdRec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


❄️ ColdRec 🔥

☃️ ColdRec is a comprehensive open-source toolkit for cold-start recommendation. In coldrec, models follow a unified pipeline, the datasets follow a unified division, and tasks include cold user/item recommendation, warm user/item recommendation, and overall user/item recommendation, targeting at providing the community with a comprehensive evaluation for cold-start recommendation.

🔧 TODO We are now enhancing the codebase for user-friendly:

  • Enforce a consistent code style.
  • Add representative new models.
  • Redundancies removal and input type standardization.
  • Fix bugs and optimize the toolkit efficiency mentioned in the issues. (Thanks for that!)
  • 🥳 Add automatic hyper-parameter tuning, you can install one more base library optuna to include this module.
  • Toolkit building with related works before 2024.

🛫 Requirements

ColdRec hopes to avoid the complicated and tedious packaging process and uses native pytorch and a small number of necessary libraries to build the codebase.

python >= 3.8.0 
torch >= 1.11.0
faiss-gpu >= 1.7.3
pandas >= 2.0.3
numpy >= 1.24.4
scikit-learn >= 1.3.2
pickle >= 0.7.5
optuna >= 3.6.1 (If you need automatic hyper-parameter tuning) 

🚀 Quick Start

1️⃣ Dataset Preprocess

We have provided the preprocessed datasets in Google Drive. You can download the dataset from the Google Drive link directly, unzip it, and place it into the ./data folder. Then, you can process it into the format for model training with simple two scripts, of which the details can be found in the page of dataset details.

2️⃣ Warm Embedding Pre-Training

This step is not necessary, but since most of the work requires this step, it is recommended to complete this step to fully evaluate all models. We have provided both widely adopted collaborative filtering models as warm recommenders. You can obtain the pre-trained warm user/item embeddings with the following two options:

Options 1: You can directly access the BPR-MF pre-trained embeddings at the Google Drive. Then, the embedding folder associated to each dataset should be placed in the ./emb folder.

Options 2: You can also pre-train the warm embedding by yourself. Specifically, you can simply obtain the pre-trained warm embeddings by running the following script:

python main.py --dataset [DATASET NAME] --model [WARM RECOMMENDER] --cold_object [user/item]

In the above script, the [DATASET NAME] for --dataset should be replaced by your target dataset name, such as movielens. Then, the [WARM RECOMMENDER] for --model should be selected as the warm recommender type (MF, NGCF, LightGCN, NCL, SimGCL, and XSimGCL). Finally, the [user/item] for --cold_object should be selected as user or item for the user cold-start setting or item cold-start setting.

3️⃣ Cold-Start Model Training and Evaluation

Coming to this step, you can start to train the cold-start model with one script:

python main.py --dataset [DATASET NAME] --model [MODEL NAME] --cold_object [user/item]

In the above script, the [MODEL NAME] for --model is the expected model name, where we have provided 20 representative models as the Supported Models. You can also flexibly register your own model with the ColdRec framework for evaluation.

4️⃣ (Option) Automatic Hyper-parameter Tuning

ColdRec also supports automatic hyper-parameter tuning. You can tune hyper-parameters with optuna with one script:

python param_search.py --dataset [DATASET NAME] --model [MODEL NAME] --cold_object [user/item]

You can flexibly set the tuning range in param_search.py.


🧸 Supported Models

(* Backbone model)

ID Paper Model Venue
1* BPR: Bayesian Personalized Ranking from Implicit Feedback BPR-MF UAI 2009
2 Deep Content-based Music Recommendation DeepMusic NeurIPS 2013
3 Social Collaborative Filtering for Cold-start Recommendations KNN RecSys 2014
4 Learning Image and User Features for Recommendation in Social Networks DUIF ICCV 2015
5 VBPR: Visual Bayesian Personalized Ranking from Implicit Feedback VBPR AAAI 2016
6 DropoutNet: Addressing Cold Start in Recommender Systems DropoutNet NeurIPS 2017
7 Adversarial Training Towards Robust Multimedia Recommender System AMR TKDE 2019
8* Neural Graph Collaborative Filtering NGCF SIGIR 2019
9 Warm Up Cold-start Advertisements: Improving CTR Predictions via Learning to Learn ID Embeddings MetaEmbedding SIGIR 2019
10* LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation LightGCN SIGIR 2020
11 How to Learn Item Representation for Cold-Start Multimedia Recommendation? MTPR MM 2020
12 LARA: Attribute-to-feature Adversarial Learning for New-item Recommendation LARA WSDM 2020
13 Recommendation for New Users and New Items via Randomized Training and Mixture-of-Experts Transformation Heater SIGIR 2020
14 Contrastive Learning for Cold-Start Recommendation CLCRec MM 2021
15* Improving Graph Collaborative Filtering with Neighborhood-enriched Contrastive Learning NCL WWW 2022
16* Are Graph Augmentations Necessary? Simple Graph Contrastive Learning for Recommendation SimGCL SIGIR 2022
17 Generative Adversarial Framework for Cold-Start Item Recommendation GAR SIGIR 2022
18 XSimGCL: Towards Extremely Simple Graph Contrastive Learning for Recommendation XSimGCL TKDE 2023
19 GoRec: A Generative Cold-start Recommendation Framework GoRec MM 2023
20 Contrastive Collaborative Filtering for Cold-Start Item Recommendation CCFRec WWW 2023
21 Aligning Distillation For Cold-start Item Recommendation ALDI SIGIR 2023
22 Fine-Tuning Out-of-Vocabulary Item Recommendation with User Sequence Imagination USIM NeurIPS 2024

💐 Acknowledgements

The codebase architecture of ColdRec on some foundational operators is based on the excellent repo SELFRec. Thanks to their pioneering open-sourced work!

The suggestions provided by open-source community users are of great help in improving this framework. Thanks to them!

About

ColdRec: An Open-Source Toolbox for Cold-Start Recommendation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages