Giter Club home page Giter Club logo

bank_customer_churn's Introduction

Bank_Customer_churn

Bank Customer Churn Prediction

Step by step Documentation for the project

  • This document will take you through the summary of this project with a result at the rend

Loading the libraries

  • Please check the requirements.txt file for the libraries used in the project.

EDA.ipynb with code explanation

  • This notebook contains the Exploratory Data Analysis of the dataset. the definition of the columns are as follows:'
  • RowNumber: Row Numbers from 1 to 10000
  • CustomerId: Unique Ids for bank customer identification
  • Surname: Customer's last name
  • CreditScore: Credit score of the customer
  • Age: Customer's age in years
  • Tenure: Number of years for which the customer has been with the bank
  • Balance: Bank balance of the customer
  • NumOfProducts: Number of bank products the customer is utilising
  • HasCrCard: Binary Flag for whether the customer holds a credit card with the bank or not
  • IsActiveMember: Binary Flag for whether the customer is an active member with the bank or not
  • EstimatedSalary: Estimated salary of the customer in Dollars
  • churn : Binary flag 1 or 0

The Project contains the following sections:

  • Data Cleaning
  • Data Visualization
  • Data Preprocessing
  • Feature Selection
  • Model Building
  • Model Evaluation
  • Model Deployment

Documentation for Model.py Deployment

  • This file contains the code for the deployment of the model using streamlit. -[x] below is the import of the libraries used in the file.
import streamlit as st
import joblib
import pandas as pd
import numpy as np
import eli5
from eli5 import explain_weights, explain_prediction
  • Below we load xgboost model using joblib.
#load the xgboost model
model = joblib.load('xgb_model.pkl')
  • Call feature_names function to get the feature names.
#call feature_names function to get the feature names
st.title('Bank Customer Churn Prediction')
age = st.number_input('Age', min_value=18, max_value=100, value=18)
credit_score = st.number_input('Credit Score', min_value=300, max_value=850, value=300)
balance = st.number_input('Balance', min_value=0, max_value=250000, value=0)
num_of_products = st.number_input('Number of Products', min_value=1, max_value=4, value=1)
tenure = st.number_input('Tenure', min_value=0, max_value=10, value=0)
has_cr_card = st.selectbox('Has Credit Card', ['Yes','No'])
is_active_member = st.selectbox('Is Active Member', ['Yes','No'])
gender = st.selectbox('Gender',['Male','Female'])
estimated_salary = st.number_input('Estimated Salary', min_value=0, max_value=250000, value=0)
geography = st.selectbox('Geography', ['France', 'Germany', 'Spain'])
  • Below we create a dictionary of the input values.
# create a dictionary of inputs
features = pd.Dataframe({'age':age, 'credit_score': credit_score,....})

the rest is history, do feel free to catch on the rest of the code in the file.

Preview of the app and predictions

image image

Conclusion

bank_customer_churn's People

Contributors

mfundo-debug 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.