Skip to content

The Bank Customer Churn Prediction app uses deep learning to predict if a bank customer will churn (leave) based on demographic and account-related data. Powered by a deep learning ANN model with TensorFlow and built with Streamlit for the front-end, this app provides an interactive interface to predict customer churn in real-time.

License

Notifications You must be signed in to change notification settings

shubhamprajapati7748/Bank-Customer-Churn-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank Customer Churn Prediction App

Table of Contents

About The Project

The Bank Customer Churn Prediction app uses deep learning to predict whether a bank customer will churn (leave the bank) or not, based on their demographic and account-related information. The app is powered by a deep learning ANN model that analyzes various features such as customer age, account balance, credit score, and services availed by the customer. Built with TensorFlow for the model and Streamlit for the front-end web application, the app offers an interactive interface to predict customer churn in real-time.

The app allows users to input a customer's data and instantly receive a prediction of the likelihood of the customer churning. The project also includes preprocessing steps like encoding categorical variables and scaling numerical inputs.

churn-prediction

About the Data

This dataset contains details of bank customers, and it is used to predict customer churn. The dataset is based on a sample of bank customers and contains various demographic and account-related features. It has been cleaned and processed for machine learning applications. The target variable, Exited, indicates whether the customer has left the bank (1 for churn, 0 for no churn).

Key Features:

  • CustomerId: Unique identifier for each customer
  • Surname: Customer surname
  • CreditScore: Credit score of the customer
  • Geography: Country of residence (e.g., France, Spain, Germany)
  • Gender: Gender of the customer (Male or Female)
  • Age: Age of the customer
  • Tenure: Number of years the customer has been with the bank
  • Balance: Account balance of the customer
  • NumOfProducts: Number of products the customer is using (e.g., checking account, savings account)
  • HasCrCard: Whether the customer has a credit card or not
  • IsActiveMember: Whether the customer is an active member or not
  • EstimatedSalary: Estimated annual salary of the customer
  • Exited: The target variable (1 if the customer has exited, 0 if the customer stayed)

Target Variable

The target variable is Exited, which represents whether the customer has churned (left the bank) or not. It is a binary classification task, with:

  • 1 indicating the customer has churned,
  • 0 indicating the customer has stayed.

Dataset Source Link

You can download the dataset from Kaggle here:
Bank Customer Churn Prediction Dataset

Technology Stack

  • Python (Programming Language)
  • Streamlit (Web Framework)
  • TensorFlow (Deep Learning Library)
  • Scikit-learn (Machine Learning Library)
  • Pandas (Data Manipulation)
  • NumPy (Numerical Computing)
  • Pickle (Model Serialization)

Getting Started

To get started with this project locally, you’ll need Python 3.8+ installed on your machine along with some necessary Python packages. You can either clone the repository and install dependencies manually or use Docker for an isolated environment.

Installation Steps

Option 1: Installation from GitHub

  1. Clone the repository:

    • Open your terminal or command prompt.
    • Navigate to the directory where you want to install the project.
    • Run the following command to clone the GitHub repository:
      git clone https://github.com/shubhamprajapati7748/Bank-Customer-Churn-Prediction.git
      
  2. Create a Virtual Environment (Optional)

    • It's a good practice to create a virtual environment to manage project dependencies. Run the following command:
      conda create -p <Environment_Name> python==<python version> -y
      
  3. Activate the Virtual Environment (Optional)

    • Activate the virtual environment based on your operating system:
      conda activate <Environment_Name>/
      
  4. Install Dependencies

    • Navigate to the project directory:
      cd [project_directory]
      
    • Run the following command to install project dependencies:
      pip install -r requirements.txt
      
  5. Run the Project

    streamlit run app.py
  6. Access the Project

    • Visit http://localhost:8501 in your browser to use the app.

Option 2: Installation from DockerHub

  1. Pull the Docker image from DockerHub (if available):

    docker pull shubhamprajapati7748/churn-prediction-app
  2. Run the app inside the container:

    docker run -p 8501:8501 shubhamprajapati7748/churn-prediction-app
  3. Visit http://localhost:8501 in your browser to use the app.

Usage and Configuration

Web App Usage:

  1. Enter Customer Information: Input fields for age, gender, geography, and other demographic and account details.
  2. Click "Predict Churn": After entering the data, click the prediction button to view the likelihood of churn and whether the customer is likely to churn or not.
  3. Prediction Results: The app will display the churn probability along with a clear message about the likelihood of churn.

Configuration:

You can modify the Artifacts/ directory to point to your own trained models, encoders, and scaler files. Make sure the model and encoders are trained and saved in compatible formats (e.g., .h5, .pkl).

Contributing

We welcome contributions to improve this project! Whether you are fixing bugs, adding features, or improving documentation, feel free to fork the repository and submit a pull request.

Steps to contribute:

  1. Fork the repo.
  2. Create a new branch (git checkout -b feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add feature').
  5. Push to your branch (git push origin feature-name).
  6. Create a new Pull Request.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Shubham Prajapati - @[email protected]

Acknowledgements

  • TensorFlow: For providing the machine learning framework to train the predictive model.
  • Streamlit: For creating the interactive web application.
  • Scikit-learn: For preprocessing utilities such as scaling and encoding.
  • Kaggle: For the inspiration behind the dataset, which is similar to the dataset used in this project.

About

The Bank Customer Churn Prediction app uses deep learning to predict if a bank customer will churn (leave) based on demographic and account-related data. Powered by a deep learning ANN model with TensorFlow and built with Streamlit for the front-end, this app provides an interactive interface to predict customer churn in real-time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published