Git Product home page Git Product logo

kaggle-safe-driver-prediction's Introduction

Kaggle Safe Driver Prediction

This repo comtains my work for the Kaggle Competition "Porto Seguro’s Safe Driver Prediction"
Link to the competition: https://www.kaggle.com/c/porto-seguro-safe-driver-prediction

Final achievement (teamwork with Yuvi Tu @NYU): Top 15%, Normalized Gini Coefficient 0.28986 (1st place 0.29698)

Summmary

Porto Seguro is one of Brazil’s largest auto and homeowner insurance companies. Inaccuracies in car insurance company’s claim predictions raise the cost of insurance for good drivers and reduce the price for bad ones. The objective of this competition is to predict the probability that a driver will initiate an auto insurance claim in the next year, given the features of individuals, cars, regions, etc.

Documentation

1st Part: Data Processing

The data given by Porto Seguro is anonymous, with 595,212 training observations and 892,816 testing observations. There are 59 variables recorded in features.xlsx.
For Exploratory Data Analysis, please refer to the terrific public kernel: Steering Wheel of Fortune - Porto Seguro EDA .
I did basic data pre-processing and one-hot-encoding and target encoding in Data Porcessing.R. For all the feature engineering work, you can find them in feature engineering.R. I have also tried SVD to detect whethere ther eis obvious clusters exist. Unfortunately, this does not seem to work here.

2nd Part: Modeling & Prediction

This problem is essentially a binary classification problem. For the modeling part, I tried XGBoost model and LightGBM model. The performance of both models are similar, but since LightGBM is much faster, and I only run on my local machine, I selected features and tunned parameters mostly on the LightGBM model. The codes could be found in the modeling folder.

3rd Part: Ensembling

For this dataset, it seems that the model ensembling method that works best is actually take the average or median of the ranks, since we are competing against normalized Gini, which is only dependent on the ranks of the predictions. I made some naive trials in the ensembling folder.

Takeaways

  1. A trustworthy local CV schema is really really important.
  2. There isn't "one rule fit for all". No matter for data processing, feature engineering, parameter tunning, model stacking, etc. Just try around and see.
  3. It's hard to judge whether you are overfitting sometimes... Many are expecting some kind of great overfitting on some public kernels, but actually they are not. I guess it could be due to the extremely imbalanced data we get, or this kind of ensembling just not easily leads to overfitting.

kaggle-safe-driver-prediction's People

Contributors

yudong-94 avatar

Stargazers

Tianyu Zhao avatar

Forkers

vivazhang

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.