Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
deepFM Create ReadMe Nov 20, 2018
din add dataset.pkl in din: cat aa ab ac > dataset.pkl Mar 13, 2019
pnn add wide_deep Jan 24, 2018
utils add all Jan 8, 2018
wide_deep Update Nov 20, 2018


Deep Interest Network for Click-Through Rate Prediction


This is an implementation of the paper Deep Interest Network for Click-Through Rate Prediction Guorui Zhou, Chengru Song, Xiaoqiang Zhu, Han Zhu, Ying Fan, Na Mou, Xiao Ma, Yanghui Yan, Xingya Dai, Junqi Jin, Han Li, Kun Gai

Thanks Jinze Bai and Chang Zhou.


  title={Deep Interest Network for Click-Through Rate Prediction},
  author={Zhou, Guorui and Song, Chengru and Zhu, Xiaoqiang and Ma, Xiao and Yan, Yanghui and Dai, Xingya and Zhu, Han and Jin, Junqi and Li, Han and Gai, Kun},


  • Python >= 2.6.1
  • NumPy >= 1.12.1
  • Pandas >= 0.20.1
  • TensorFlow >= 1.4.0 (Probably earlier version should work too, though I didn't test it)
  • GPU with memory >= 10G

Download dataset and preprocess

  • Step 1: Download the amazon product dataset of electronics category, which has 498,196 products and 7,824,482 records, and extract it to raw_data/ folder.
mkdir raw_data/;
cd utils;
  • Step 2: Convert raw data to pandas dataframe, and remap categorical id.

Training and Evaluation

This implementation not only contains the DIN method, but also provides all the competitors' method, including Wide&Deep, PNN, DeepFM. The training procedures of all method is as follows:

  • Step 1: Choose a method and enter the folder.
cd din;

Alternatively, you could also run other competitors's methods directly by cd deepFM cd pnn cd wide_deep, and follow the same instructions below.

  • Step 2: Building the dataset adapted to current method.

We put a processed data 'dataset.pkl' in DeepInterestNetwork/din. Considering the GitHub's file size limit of 100.00 MB, we split it into 3 file aa ab ac.

cat aa ab ac > dataset.pkl

  • Step 3: Start training and evaluating using default arguments in background mode.
python >log.txt 2>&1 &
  • Step 4: Check training and evaluating progress.
tail -f log.txt
tensorboard --logdir=save_path


There is also an implementation of Dice in folder 'din', you can try dice following the code annotation in din/ or replacing with

You can’t perform that action at this time.