ensemble_amazon

April 7, 2016 ยท View on GitHub

Code to share different ensemble techniques with focus on meta-stacking , using data from Amazon.com - Employee Access Challenge kaggle competition

This code is part of the EE381V Large-Scale Machine Learning PhD level course in the University of Texas (Taught by Alexandros G. Dimakis) and aims to show different ensemble techniques for AUC type of problems (classification).

The code is for education purposes and did not aim to achieve a high score.

Requirements

  • Python 2.7
  • Xgboost
  • Sklearn
  • numpy
  • scipy
  • pandas

download the train.csv and test.csv data from the kaggle competition : Amazon.com - Employee Access Challenge Link: https://www.kaggle.com/c/amazon-employee-access-challenge

The ensemble methods

  • The code initially creates a couple of models on different transformations of the data and saves the out-of-fold predictions
  • We start testing different ensemble techniques as: - Simple average - Weighted average based on cv - Weighted Rank Average based on cv - Geomean Weighted Rank Average based on cv - Use another model (ExtraTreesClassifier from sklearn) to perform meta-stacking

Replicate solution

Inisde a folder that the train.csv and test.csv are present :

  • Run amazon_main_xgboost_count_2D.py
  • Run amazon_main_logit_3way_best.py
  • Run amazon_main_logit_2D.py
  • Run amazon_main_xgboost.py
  • Run amazon_main_logit_3way.py
  • Run amazon_main_xgboost_count.py
  • Run amazon_main_xgboost_count_3D.py

This will yield the following results in Kaggle's Private Leaderboard and internal 5-fold cv

Model nameAUC - Private LBAUC- CV 5-fold
main_xgboost0.890960.876971
amazon_main_logit_2D0.895340.877267
main_logit_3way0.895540.878507
main_logit_3way_best0.897920.882932
main_xgboos_count0.881870.870671
main_xgboos_count_2D0.901270.888981
main_xgboos_count_3D0.9040.893425
  • Run AUC_Average.py
  • Run AUC_Weighted_Average.py
  • Run AUC_Rank_Weighted_Average.py
  • Run AUC_Geo_Rank_Weighted_Average.py
  • Run amazon_stacking.py

This will yield:

Model nameAUC - Private LBAUC- CV 5-fold
AUC_Average0.907250.893209
AUC_Weighted_Average0.911210.899529
AUC_Rank_Weighted_Average0.909160.897925
AUC_Geo_Rank_Weighted_Average0.909880.898586
amazon_stacking0.912060.899851