Giter VIP home page Giter VIP logo

awesome-recsystem-models's Introduction

Implements of Awesome RecSystem Models with PyTorch/TF2.0

1. Requirements

  • TensorFlow2.0, PyTorch1.2+, Python3.6, NumPy, sk-learn, Pandas

2. DataSets

  • Criteo
    • This dataset Contains about 45 million records. There are 13 features taking integer values (mostly count features) and 26 categorical features.
    • The columns are tab separated with the following sechema: <int feat 1>...<int feat 13><cate feat 1>...
    • The dataset is available at http://labs.criteo.com/2014/02/download-kaggle-display-advertising-challenge-dataset/
    • Put the downloaded 'train.txt' file in 'data/Criteo/' folder.
  • Movielens100K
    • MovieLens 100K movie ratings. Stable benchmark dataset for Recommendation System.
    • This dataset contain 100,000 ratings from 1000 users on 1700 movies.
    • The details can be found at https://grouplens.org/datasets/movielens/100k/
    • This dataset have been downloaded and is available at 'data/Movielens100K'

3. Implemented Models:

  • FM: Factorization Machine
    • The paper is available at: https://www.csie.ntu.edu.tw/~b97053/paper/Rendle2010FM.pdf
    • Tested dataset: Criteo
    • Split the data set by 9:1 for train and test.
    • How To Run: Run data/forOtherModels/dataPreprocess_PyTorch.py to pre-process the data, then run Model/FM_PyTorch.py. Or run data/forOtherModels/dataPreprocess_TensorFlow.py to pre-process the data, and run Model/FM_TensorFlow.py
    • the result is AUC: 0.7805(PyTorch), 0.7791(TensorFlow)
    • For Multi-Classification implements:
      • Tested dataset: Movielens100K
      • Run FM_Multi_PyTorch.py
  • FFM: Field-aware Factorization Machine
  • DeepFM: Factorization-Machine based Neural Network
    • The paper is available at: https://www.ijcai.org/proceedings/2017/0239.pdf
    • Tested dataset: Criteo
    • Split the data set by 9:1 for train and test.
    • How To Run: Run data/forOtherModels/dataPreprocess_PyTorch.py to pre-process the data, then run Model/DeepFM_PyTorch.py. Or run data/forOtherModels/dataPreprocess_TensorFlow.py to pre-process the data, and run Model/DeepFM_TensorFlow.py
    • PyTorch: After 3 Epochs, AUC: 0.795(The paper result is 0.801)
    • TensorFlow: After 3 Epochs, AUC: 0.8014, LogLoss: 0.4516
  • DCN: Deep&Cross Network
    • The paper is available at: https://arxiv.org/pdf/1708.05123.pdf

    • Tested dataset: Criteo

    • Run data/forDCN/DCN_dataPreprocess_PyTorch.py to pre-process the data. According to the paper, the data set is split by 9:0.5:0.5 for train, test and valid

    • Split the data set by 9:0.5:0.5 for train, test and valid

    • Run Model/DeepCrossNetwork_PyTorch.py, and the results are as follows:

      Epochs AUC LogLoss
      1st 0.80157 0.45192
      2nd 0.80430 0.44922
      3rd 0.80546 0.44817
      4th 0.80639 0.44729
      5th 0.80696 0.44678
  • xDeepFM: eXtreme Deep Factorization Machine
    • The Paper is available at: https://arxiv.org/pdf/1803.05170.pdf
    • Tested dataset: Criteo
    • Split the data set by 9:1 for train and test.
    • Run data/forXDeepFM/xDeepFM_dataPreprocess_PyTorch.py to pre-process the data. The pre-process of xDeepFM is identical with that of DeepFM.
    • Run Model/xDeepFM_PyTorch.py.
    • After 5 epochs, the result is AUC 0.80148, LogLoss 0.45104 (The paper result is AUC 0.8052).
  • PNN: Product-based Neural Network
    • Paper: https://arxiv.org/pdf/1611.00144.pdf

    • Tested dataset: Criteo

    • Split the data set by 9:1 for train and test.

    • How To Run: Run data/forOtherModels/dataPreprocess_PyTorch.py to pre-process the data, then run Model/ProductNeuralNetwork_PyTorch.py

    • After 5 epochs, the results are AUC:

      Framework(Algorithm) AUC LogLoss
      PyTorch(IPNN) 0.76585 0.47766
      PyTorch(OPNN) 0.77656 0.46988
      TensorFlow(IPNN) 0.77996 0.46827
      TensorFlow(OPNN) 0.78098 0.46718

awesome-recsystem-models's People

Contributors

jianzhouzhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-recsystem-models's Issues

PNN-tensorflow

I maybe found a bug,
in pnn-tensorflow def call(feat_index,feat_value)
feat_embedding = self.feat_embeddings(feat_index) # Batch * N * M
feat_value is not used,so,
I think the feat_embedding layer should * feat_value .
the code is

        feat_embedding_0 = self.feat_embeddings(feat_index) # Batch * N * M 
        feat_embedding = tf.einsum('bnm,bn->bnm',feat_embedding_0,feat_value)
        # linear part 
        lz = tf.einsum('bnm,dnm->bd',feat_embedding,self.linear_weights) # Batch * D1

类别型特征处理

image
你好,为什么处理类别型特征要这样处理,为啥不进行label_encoder处理
还有计算fm的时候,下面是什么意思,可以解释一下吗,为啥要用到feat_index
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.