Code Monkey home page Code Monkey logo

us_census's Introduction

us_census

The goal of this exercise is to model the information contained in the last column (42nd), i.e., which people make more or less than $50,000 / year, from the information contained in the other columns. The exercise here consists of modeling a binary variable.

Local development

Python >= 3.8

virtualenv -p python3.8 venv
source venv/bin/activate
pip3 install -r requirements.txt

make run

Trace:

  • All results files are contained :here
  • Report on descriptive analysis is stored: here
  • Log file is stored: here
  • Ml pipeline file is stored: here

Census prediction - V1

The descriptive analysis has been done with pandas profiling (and tfdv - on notebooks).

MLPipeline is designed according the best practices of Scikit-learn. Basic feature engineering has been implemented:

  • kbinsdiscretizer on numericals columns (number of bins set arbitrarily)
  • one hot encoder on categorical columns (the initial objective was to mix label and one hot encoder according to the relation between the categories - lack of time)
  • custom scikit transformer has been implemented : it's a target encoding with bayesian approach (to avoid overfit)

The experiments have been tracked with the mlflow tracking api combined with optuna for a fast hyperparameter optimisation

plot

The model used is a randomforest classifier : as this model works with thresholds, the outliers treatments hasn't been prioritized

Clear improvements :

  • A lot of numerical columns has a high percentage of 0 : a deeper analysis has to be conducted to deal with this issue
  • A lot of categorical columns has to much categories (high cardinality) : custom treatment has to be implemented instead of a one hot encoding for all columns
  • Some columns are redundant and add white noises in the model learning

To do :

us_census's People

Contributors

damien1994 avatar

Stargazers

Soufiane Benzaoui avatar

Watchers

 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.