GithubHelp home page GithubHelp logo

tgin's Introduction

TGIN

Tensorflow implementation of our method: "Triangle Graph Interest Network for Click-through Rate Prediction".

Files in the folder

  • dataset/
    • electronics/
      • uid_voc.pkl: users;
      • mid_voc.pkl: items;
      • cat_voc.pkl: categories;
      • item-info: mapping dict {item:category};
      • reviews-info: interaction records [user, item, rating, timestamp];
      • local_train_splitByUser: train data;
      • local_test_splitByUser: test data;
      • wnd3_alpha_01_theta_09_tri_num_10: triangles data with α=0.1 and θ=0.9;
  • triangle_data/: processed triangles data of the public datasets.
  • script/: implementations of TGIN.
  • triangle_mapreduce.zip: MapReduce implementations of triangle extraction and selection.

Prepare data

1. interaction data

We have processed the raw data and upload it to the electronics/ fold. You can use it directly.

Also, you can get the data from the amazon website and process it using the script:

sh prepare_data.sh

2. co-occurrence graph

You can use the processed triangles data directly, and just skip this step.

python script/gen_wnd_edges.py

3. triangle extraction and selection

We have extracted and selected the triangles of both amazon(books) and amazon(electronics) datasets. You can download and put it into the triangle_data/ folder.

Next, the triangle indexes should be transformed into the input format of the TGIN model.

python process_tridata.py

Also, you can refer to the MapReduce source code in triangle_mapreduce.zip folder to generate triangle indexes.

Train Model

(Recommended) You can skip all the previous steps and run the TGIN model using the script directly.

tar xvf triangle_data/electronics_triangle.tar.gz
tar xvf dataset/electronics.tar.gz 
python script/process_tridata.py

sh run.sh

Required packages

The code has been tested running under Python 2.7.18, with the following packages installed (along with their dependencies):

  • cPickle == 1.17
  • numpy == 1.16.6
  • keras == 2.0.8
  • tensorflow-gpu == 1.5.0

tgin's People

Contributors

alibaba-oss avatar samlive 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

Watchers

 avatar  avatar  avatar  avatar

tgin's Issues

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.