Giter Site home page Giter Site logo

customer-churn-prediction's Introduction

Customer-Churn-Prediction

A web-application made with flask that predicts whether a customer will churn or not

Link to the Web Application: https://churn-prediction.onrender.com

Built with



Exploratory Data Analysis

The data preprocessing and EDA can be found in the EDA.ipynb jupyter notebook. The data was preprocessed to remove duplicates, the dropping the Null values as the percentage of Null values was small. EDA techniques used include univariate and bivariate analysis to draw inferences about how the churn is correlated to different data features.

Inferences drawn from EDA:
  • Customers who use Electronic Check are the higest churners
  • Customers with long term contracts are more likely to churn than the customers with short term contracts
  • Customers with no tech support churn more
  • Senior citizens are less likely to churn compared to non senior citizens

Model Building

This can be found in the Churn_Model.ipynb jupyter notebook The numeric values such as TotalCharges and MonthlyCharges were used without any changes and the categorical values such as gender, paymentMethod, etc. were one hot encoded

Initially the model was trained one the original preprocessed data with Decision Tree and the following results werwe obtained:

  • Accuracy: 0.79
  • Precision: 0.74
  • Recall: 0.71
  • F1 Score: 0.72

The performance of the model was not good, and was as expected because the dataset is skewed, with less samples for No Churn. Upsampling with SMOTE-ENN and retraining the model, significantly improved the performance of the model, with the following results:

  • Accuracy: 0.94
  • Precision: 0.94
  • Recall: 0.94
  • F1 Score: 0.94

Apart from decision tree, different models were trained such as Random Forest Classifier and XGBoost. On comparing the results no significant difference was found in the performance of these models.

Web Application

The web applicatoin takes the input from the user for differnt features such as MonthlyCharges, Payment Method, Contract type, etc. and displays a message whether the customer with the given input features is likely to churn or not, along with the confidence of the prediction.

The front-end of the web application is made with HTML, CSS, bootstrap and in the back-end Flask is used. This web application is deployed on Render, and the link to it can be found at the top.

customer-churn-prediction's People

Contributors

11-aryan avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

pakinbasker

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.