Git Product home page Git Product logo

manu87ds / unittest-predict-bank-customer-churn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nicholas-dinicola/unittest-predict-bank-customer-churn

0.0 0.0 0.0 42.96 MB

The project aims to build a machine learning model able to predict if a bank customer will churn or not, utilising a production-quality code as well as through performing unit tests.

License: MIT License

Python 1.24% Jupyter Notebook 98.76%

unittest-predict-bank-customer-churn's Introduction

Predict Customer Churn

Project Description

The project aims to build a machine learning model able to predict if a bank customer will churn or not, utilising a production-quality code as well as through performing unit tests. In order to better understand the problem, the required exploratory data analysis has been performed, understanding the dataset in a clearer way, generating uni-variate and multi-variate plots. Afterwards, the necessary feature engineering preprocessing steps have been completed and two models were trained, a Random Forest (using a Grid Search Cross-Validation) and a Logistic Regression. We firstly completed all the above-mentioned analysis in an interactive notebooks. Afterwards, code have been refactored and cleaned, creating a modular code in a python library able to undertake all the analysis done in the notebook. Furthermore, the python library has been tested with logging and uni tests. The results all the tests as well as the trained model, model scores and EDA graphs have been saved in specific folders. Lastly, all the code has been cleaned and formatted following the PEP8 standards.

Running Files

Install Packages:

  • pip install -r requirements.txt

The iPython notebook documents all the analysis steps.

Running $ python3 churn_library.py in the command line you will read in the dataset, perform EDA and Feature Engineering as well as training the Random Forest and Logistic Regression algorithms. The results of the EDA are visible in the directory images/eda, while the models' classification report are stored in directory images/results.

The PEP8 score is visible by running $ pylint churn_library.py (it scored above 8/10).

Running "$ python3 churn_script_logging_and_tests.py" you will perform uni tests on the churn_library.py file. The results of each unit tests is stored in the churn_library.log file in the logs directory.

The Also this file follows the PEP8 standard, the score is visible by running $ pylint churn_script_logging_and_tests.py (it scored above 8/10).

The peakle file containing the two trained models are in rhe models directory.

Lastly, the code has been cleaned and formatted also by running $ autopep8 --in-place --aggressive --aggressive name_of_the_file.py.

unittest-predict-bank-customer-churn's People

Contributors

nicholas-dinicola 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.