Giter Club home page Giter Club logo

deepgbm's Introduction

DeepGBM

Implementation for the paper "DeepGBM: A Deep Learning Framework Distilled by GBDT for Online Prediction Tasks", which has been accepted by KDD'2019 as an Oral Paper, in the Research Track. You can get more information from the video and the paper.

If you find this code useful in your research, please cite the paper:

Guolin Ke, Zhenhui Xu, Jia Zhang, Jiang Bian, and Tie-Yan Liu. "DeepGBM: A Deep Learning Framework Distilled by GBDT for Online Prediction Tasks." In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2019: 384-394.

Brief Introduction

This repo is built for the experimental codes in our paper, containing all the data preprocessing, baseline models implementation and proposed model implementation (full codes here). For quick start, here we only show the codes related to our model. For GBDT based model, our implementation is based on LightGBM. For NN based model, our implementation is based on pytorch.

There are three main folders in the project, data is for data storage, preprocess is the folder containing feature selection and encoding, models contains all the implementation codes of the proposed model. For more detailed experiments codes, refer to the experiments folder.

Besides, main.py is the entry code file for our model. Besides, data_helpers.py contains the data loader, helper.py contains the general training and testing logic for NN. train_models.py is for the specific training process of the model. In models, there are some implementations of main models. tree_model_interpreter.py is used for interpreting the trained GBDT's structure.

Environment Setting

The main dependency is shown as follows:

  • Python==3.6.6
  • LightGBM==2.2.1
  • Pytorch==0.4.1
  • Sklearn==0.19.2

Quick Start

All the datasets should be converted into .csv files first and then processed by encoders in preprocess. The features used for each dataset could be seen in preprocess/encoding_*.py, the main function specifically.

To run DeepGBM, after the above step, you will prepare your data in .npy format. Then we can use the function in data_helpers.py to load its numerical part and categorical part:

num_data = dh.load_data(args.data+'_num')
cate_data = dh.load_data(args.data+'_cate')
# following is designed for faster catNN inputs
cate_data = dh.trans_cate_data(cate_data)

On the contrary, if you run GBDT2NN or CatNN only, you can only feed the numerical data or categorical data into the model. Then, you can call the functions in train_models.py like:

train_GBDT2NN(args, num_data, plot_title)
# or
train_DEEPGBM(args, num_data, cate_data, plot_title)

Thanks for your visiting, and if you have any questions, please new an issue.

deepgbm's People

Contributors

motefly avatar guolinke avatar

Watchers

James Cloos avatar

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.