All Projects → Coder-Yu → Recq

Coder-Yu / Recq

Licence: gpl-3.0
RecQ: A Python Framework for Recommender Systems (TensorFlow Based)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Recq

Recsys course at polimi
This is the official repository for the Recommender Systems course at Politecnico di Milano.
Stars: ✭ 180 (-79.61%)
Mutual labels:  algorithm, recommender-system
Prince
Implementing PopRouting
Stars: ✭ 11 (-98.75%)
Mutual labels:  algorithm
Naive Bayes Classifier
Naive Bayes classifier is classification algorithm. It uses Naive based Bernoulli and Multinomial equation to classify documents(Text) as ham or spam.
Stars: ✭ 6 (-99.32%)
Mutual labels:  algorithm
Model Describer
model-describer : Making machine learning interpretable to humans
Stars: ✭ 22 (-97.51%)
Mutual labels:  algorithm
Xstrings
Implements string functions widely used in other languages but absent in Go.
Stars: ✭ 888 (+0.57%)
Mutual labels:  algorithm
Randompicker
一个动态权重的随机算法
Stars: ✭ 24 (-97.28%)
Mutual labels:  algorithm
Torbot
Dark Web OSINT Tool
Stars: ✭ 821 (-7.02%)
Mutual labels:  algorithm
Polysnap
A work in progress polygon operations library with integer snap-rounding
Stars: ✭ 14 (-98.41%)
Mutual labels:  algorithm
Algo.js
A Very Basic into Intermediate Algorithm Lesson
Stars: ✭ 11 (-98.75%)
Mutual labels:  algorithm
Fastfm
fastFM: A Library for Factorization Machines
Stars: ✭ 908 (+2.83%)
Mutual labels:  recommender-system
Avax
AVAX is a small, modern and fast console application for decrypting passwords with certain options.
Stars: ✭ 19 (-97.85%)
Mutual labels:  algorithm
History tree
A persistent history tree for undo/redo
Stars: ✭ 17 (-98.07%)
Mutual labels:  algorithm
Php Interview
PHP后端开发面试指南。
Stars: ✭ 26 (-97.06%)
Mutual labels:  algorithm
100 Days Of Ios Datastructure Algorithm
100天iOS数据结构与算法实战
Stars: ✭ 836 (-5.32%)
Mutual labels:  algorithm
Phpalgorithms
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell
Stars: ✭ 865 (-2.04%)
Mutual labels:  algorithm
Javascript Algorithms
Stars: ✭ 6,893 (+680.63%)
Mutual labels:  algorithm
Nsga Ii
an implementation of NSGA-II in java
Stars: ✭ 18 (-97.96%)
Mutual labels:  algorithm
Recsys19 hybridsvd
Accompanying code for reproducing experiments from the HybridSVD paper. Preprint is available at https://arxiv.org/abs/1802.06398.
Stars: ✭ 23 (-97.4%)
Mutual labels:  recommender-system
Clustering
fast clustering algorithms
Stars: ✭ 14 (-98.41%)
Mutual labels:  algorithm
Mrsr
MRSR - Matlab Recommender Systems Research is a software framework for evaluating collaborative filtering recommender systems in Matlab.
Stars: ✭ 13 (-98.53%)
Mutual labels:  algorithm

RecQ

Introduction

Founder: @Coder-Yu
Main Contributors: @DouTong @Niki666 @HuXiLiFeng @BigPowerZ @flyxu

RecQ is a Python library for recommender systems (Supported by Python 2.7.x and Tensorflow) in which a number of influential and newly state-of-the-art recommendation models are implemented. To run RecQ easily, see requirements.txt to install all dependencies.

What's New

16/01/2021 - MHCN proposed in our WWW'21 paper has been added. 22/09/2020 - DiffNet proposed in SIGIR'19 has been added. 19/09/2020 - DHCF proposed in KDD'20 has been added for comparison, althought it doesn't work very well. 29/07/2020 - ESRF proposed in my TKDE paper has been added. 23/07/2020 - LightGCN proposed in SIGIR'20 has been added. 17/09/2019 - NGCF proposed in SIGIR'19 has been added. 13/08/2019 - RSGAN proposed in ICDM'19 has been added. 09/08/2019 - Our paper is accepted as full research paper by ICDM'19. 02/20/2019 - IRGAN proposed in SIGIR'17 has been added (tuning...) 02/12/2019 - CFGAN proposed in CIKM'18 has been added. 02/04/2019 - NeuMF proposed in WWW'17 has been added. 10/09/2018 - An Adversarial training based Model: APR has been implemented. 10/02/2018 - Two deep models: DMF CDAE have been implemented. 07/12/2018 - Algorithms supported by TensorFlow: BasicMF, PMF, SVD, EE (Implementing...)

Architecture of RecQ

RecQ Architecture

Features

  • Cross-platform: as a Python software, RecQ can be easily deployed and executed in any platforms, including MS Windows, Linux and Mac OS.
  • Fast execution: RecQ is based on the fast scientific computing libraries such as Numpy and some light common data structures, which make it run much faster than other libraries based on Python.
  • Easy configuration: RecQ configs recommenders using a configuration file.
  • Easy expansion: RecQ provides a set of well-designed recommendation interfaces by which new algorithms can be easily implemented.

How to Run it

  • 1.Configure the **xx.conf** file in the directory named config. (xx is the name of the algorithm you want to run)
  • 2.Run the **main.py** in the project, and then input following the prompt.

How to Configure it

Essential Options

Entry Example Description
ratings D:/MovieLens/100K.txt Set the path to input dataset. Format: each row separated by empty, tab or comma symbol.
social D:/MovieLens/trusts.txt Set the path to input social dataset. Format: each row separated by empty, tab or comma symbol.
ratings.setup -columns 0 1 2 -columns: (user, item, rating) columns of rating data are used; -header: to skip the first head line when reading data
social.setup -columns 0 1 2 -columns: (trustor, trustee, weight) columns of social data are used; -header: to skip the first head line when reading data
recommender UserKNN/ItemKNN/SlopeOne/etc. Set the recommender to use.
evaluation.setup -testSet ../dataset/testset.txt Main option: -testSet, -ap, -cv -testSet path/to/test/file (need to specify the test set manually) -ap ratio (ap means that the ratings are automatically partitioned into training set and test set, the number is the ratio of test set. e.g. -ap 0.2) -cv k (-cv means cross validation, k is the number of the fold. e.g. -cv 5) Secondary option:-b, -p, -cold
    -b val (binarizing the rating values. Ratings equal or greater than val will be changed into 1, and ratings lower than val will be changed into 0. e.g. -b 3.0) -p (if this option is added, the cross validation wll be executed parallelly, otherwise executed one by one) -tf (model training would be conducted on TensorFlow if TensorFlow has been installed) -cold threshold (evaluation on cold-start users, users in training set with ratings more than threshold will be removed from the test set)
item.ranking off -topN -1 Main option: whether to do item ranking
-topN N1,N2,N3...: the length of the recommendation list. *RecQ can generate multiple evaluation results for different N at the same time
output.setup on -dir ./Results/ Main option: whether to output recommendation results -dir path: the directory path of output results.

Memory-based Options

similarity pcc/cos Set the similarity method to use. Options: PCC, COS;
num.shrinkage 25 Set the shrinkage parameter to devalue similarity value. -1: to disable simialrity shrinkage.
num.neighbors 30 Set the number of neighbors used for KNN-based algorithms such as UserKNN, ItemKNN.

Model-based Options

num.factors 5/10/20/number Set the number of latent factors
num.max.iter 100/200/number Set the maximum number of iterations for iterative recommendation algorithms.
learnRate -init 0.01 -max 1 -init initial learning rate for iterative recommendation algorithms;
-max: maximum learning rate (default 1);
reg.lambda -u 0.05 -i 0.05 -b 0.1 -s 0.1 -u: user regularizaiton; -i: item regularization; -b: bias regularizaiton; -s: social regularization

How to extend it

  • 1.Make your new algorithm generalize the proper base class.
  • 2.Rewrite some of the following functions as needed.
          - readConfiguration()
          - printAlgorConfig()
          - initModel()
          - buildModel()
          - saveModel()
          - loadModel()
          - predict()

Algorithms Implemented

Note: We use SGD to obtain the local minimum. So, there have some differences between the original papers and the code in terms of fomula presentation. If you have problems in understanding the code, please open an issue to ask for help. We can guarantee that all the implementations are carefully reviewed and tested.

Any suggestions are welcome. We will make efforts to improve RecQ.

       
Rating prediction Paper
SlopeOne Lemire and Maclachlan, Slope One Predictors for Online Rating-Based Collaborative Filtering, SDM'05.
PMF Salakhutdinov and Mnih, Probabilistic Matrix Factorization, NIPS'08.
SoRec Ma et al., SoRec: Social Recommendation Using Probabilistic Matrix Factorization, SIGIR'08.
SVD++ Koren, Factorization meets the neighborhood: a multifaceted collaborative filtering model, SIGKDD'08.
RSTE Ma et al., Learning to Recommend with Social Trust Ensemble, SIGIR'09.
SVD Y. Koren, Collaborative Filtering with Temporal Dynamics, SIGKDD'09.
SocialMF Jamali and Ester, A Matrix Factorization Technique with Trust Propagation for Recommendation in Social Networks, RecSys'10.
EE Khoshneshin et al., Collaborative Filtering via Euclidean Embedding, RecSys'10.
SoReg Ma et al., Recommender systems with social regularization, WSDM'11.
LOCABAL Tang, Jiliang, et al. Exploiting local and global social context for recommendation, AAAI'13.
SREELi et al., Social Recommendation Using Euclidean embedding, IJCNN'17.
CUNE-MFZhang et al., Collaborative User Network Embedding for Social Recommender Systems, SDM'17.
                       
Item Ranking Paper
BPR Rendle et al., BPR: Bayesian Personalized Ranking from Implicit Feedback, UAI'09.
WRMFYifan Hu et al.Collaborative Filtering for Implicit Feedback Datasets, KDD'09.
SBPR Zhao et al., Leveraing Social Connections to Improve Personalized Ranking for Collaborative Filtering, CIKM'14
ExpoMF Liang et al., Modeling User Exposure in Recommendation, WWW''16.
CoFactor Liang et al., Factorization Meets the Item Embedding: Regularizing Matrix Factorization with Item Co-occurrence, RecSys'16.
TBPRWang et al. Social Recommendation with Strong and Weak Ties, CIKM'16'.
CDAE Wu et al., Collaborative Denoising Auto-Encoders for Top-N Recommender Systems, WSDM'16'.
DMF Xue et al., Deep Matrix Factorization Models for Recommender Systems, IJCAI'17'.
NeuMFHe et al. Neural Collaborative Filtering, WWW'17.
CUNE-BPRZhang et al., Collaborative User Network Embedding for Social Recommender Systems, SDM'17'.
IRGAN Wang et al., IRGAN: A Minimax Game for Unifying Generative and Discriminative Information Retrieval Models, SIGIR'17'.
SERec Wang et al., Collaborative Filtering with Social Exposure: A Modular Approach to Social Recommendation, AAAI'18'.
APR He et al., Adversarial Personalized Ranking for Recommendation, SIGIR'18'.
IF-BPRYu et al. Adaptive Implicit Friends Identification over Heterogeneous Network for Social Recommendation, CIKM'18'.
CFGANChae et al. CFGAN: A Generic Collaborative Filtering Framework based on Generative Adversarial Networks, CIKM'18.
NGCF Wang et al. Neural Graph Collaborative Filtering, SIGIR'19'.
DiffNet Wu et al. A Neural Influence Diffusion Model for Social Recommendation, SIGIR'19'.
RSGAN Yu et al. Generating Reliable Friends via Adversarial Learning to Improve Social Recommendation, ICDM'19'.
LightGCN He et al. LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation, SIGIR'20.
DHCF Ji et al. Dual Channel Hypergraph Collaborative Filtering, KDD'20.
ESRF Yu et al. Enhancing Social Recommendation with Adversarial Graph Convlutional Networks, TKDE'20.
MHCN Yu et al. Self-Supervised Multi-Channel Hypergraph Convolutional Network for Social Recommendation, WWW'21.

Category

Generic Recommenders
UserKNN ItemKNN BasicMF SlopeOne SVD PMF SVD++ EE BPR WRMF
ExpoMF NGCF LightGCN IRGAN CFGAN
Social Recommenders
RSTE SoRec SoReg SocialMF SBPR SREE LOCABAL SocialFD TBPR SERec
RSGAN IF-BPR MHCN CUNE ESRF
Deep Recommenders
APR CDAE DMF NeuMF CFGAN IRGAN LightGCN NGCF MHCN DHCF
Diffnet ESRF
Baselines
UserMean ItemMean MostPopular Rand

Related Datasets

   
Data Set Basic Meta User Context
Users ItemsRatings (Scale) Density Users Links (Type)
Ciao [1] 7,375 105,114 284,086 [1, 5] 0.0365% 7,375 111,781 Trust
Epinions [2] 40,163 139,738 664,824 [1, 5] 0.0118% 49,289 487,183 Trust
Douban [3] 2,848 39,586 894,887 [1, 5] 0.794% 2,848 35,770 Trust
LastFM [4] 1,892 17,632 92,834 implicit 0.27% 1,892 25,434 Trust

Reference

[1]. Tang, J., Gao, H., Liu, H.: mtrust:discerning multi-faceted trust in a connected world. In: International Conference on Web Search and Web Data Mining, WSDM 2012, Seattle, Wa, Usa, February. pp. 93–102 (2012)

[2]. Massa, P., Avesani, P.: Trust-aware recommender systems. In: Proceedings of the 2007 ACM conference on Recommender systems. pp. 17–24. ACM (2007)

[3]. G. Zhao, X. Qian, and X. Xie, “User-service rating prediction by exploring social users’ rating behaviors,” IEEE Transactions on Multimedia, vol. 18, no. 3, pp. 496–506, 2016.

[4]. Iván Cantador, Peter Brusilovsky, and Tsvi Kuflik. 2011. 2nd Workshop on Information Heterogeneity and Fusion in Recom- mender Systems (HetRec 2011). In Proceedings of the 5th ACM conference on Recommender systems (RecSys 2011). ACM, New York, NY, USA

Thanks

If our project is helpful to you, please cite one of these papers. @inproceedings{yu2018adaptive, title={Adaptive implicit friends identification over heterogeneous network for social recommendation}, author={Yu, Junliang and Gao, Min and Li, Jundong and Yin, Hongzhi and Liu, Huan}, booktitle={Proceedings of the 27th ACM International Conference on Information and Knowledge Management}, pages={357--366}, year={2018}, organization={ACM} } @article{yu2019generating, title={Generating Reliable Friends via Adversarial Training to Improve Social Recommendation}, author={Yu, Junliang and Gao, Min and Yin, Hongzhi and Li, Jundong and Gao, Chongming and Wang, Qinyong}, booktitle={2019 IEEE International Conference on Data Mining (ICDM)}, pages={768--777}, year={2019}, organization={IEEE}, }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].