Skip to content

Luffy-Yao/LightGBM_Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

LightGBM_Application

LightGBM is a gradient boosting framework that uses tree based learning algorithm. This repository presents an application using LightGBM.

LightGBM Installation

Follow the instructions here to install LightGBM. Use the following bash command to incorporate lightgbm into your Anaconda platform

conda install -c conda-forge lightgbm

Data Description

A very small dataset with 400 rows and 5 columns We want to predict whether the customer will buy the product from advertise given his age and estimated salary. This dataset contains no missing values and has been standardized into a proper format.

Usage

In order to perform LightGBM on this dataset, we need to convert our training data into LightBGM data format. Also, we need to fine tune the parameters for better performance.

import lightgbm as lgb
d_train = lgb.Dataset(x_train, label=y_train)
params = {}
params['learning_rate']=0.003
params['boosting_type']='gbdt'
params['objective']='binary'
params['metric']='binary_logloss'
params['sub_feature']=0.5
params['num_leaves']=10
params['min_data']=50
params['max_depth']=10

Result

LightGBM achieves 94% accuracy with 500 iterations on this dataset. Also, the resulting confusion matrix shows low false positive rate and low negative rate for LightGBM.