Skip to content

nursena8/BankCustomerProject

Repository files navigation

Danger note:You can open my website with google chorme maybe safari can't open this.

Bank Customer Churn Prediction Project

  • This project is developed to predict the likelihood of churn for bank customers. The project has gone through various stages, including analyzing customer behaviors, making predictions with various models, and evaluating the performance of the model.

  • The insights obtained from the project contribute to providing valuable feedback to the bank, enabling it to improve and retain customers. By understanding various customer behaviors, the bank can make informed decisions to enhance its services and address any areas that may lead to customer churn.

Project Objectives

The main objectives of the project are as follows:

  • Analyze and visualize customer behaviors.
  • Develop various models to predict the likelihood of customer churn.
  • Use different methods to select the best model and optimize it.
  • Monitor and evaluate the model's performance using Evident AI.

Overview

The main objectives of this project are as follows:

  • Analyze and Visualize Customer Behaviors:

    • Utilized exploratory data analysis (EDA) techniques to gain insights into customer behaviors.
    • Visualized key metrics using Matplotlib and other data visualization tools.
  • Develop Predictive Models:

    • Built various machine learning models to predict the likelihood of customer churn.
    • Explored classification and clustering models to capture different aspects of customer behavior.
  • Model Optimization:

    • Employed different methods to select the best-performing model.
    • Utilized hyperparameter tuning and grid search to optimize model performance.
  • Monitoring with Evident AI:

    • Incorporated Evident AI for model monitoring and evaluation.
    • Evaluated the model's performance over time and made necessary adjustments.

Models

  • Classification model(GBM,RandomForestClassifier,SVC..)
  • Cluster model(KMeans)

Feature Importance:

  • Identified key features influencing customer churn through feature importance analysis.

Segmentation Insights:

  • Leveraged clustering models to gain insights into customer segmentation.
  • Discovered patterns in customer behavior and preferences.

Technologies Used:

  1. Python:

    • The project is developed in Python, a language well-suited for data science projects due to its extensive library support and rapid prototyping capabilities.
  2. Pandas:

    • Pandas, used for data manipulation and analysis, played a crucial role in processing and preprocessing the dataset.
  3. NumPy:

    • NumPy, essential for numerical computations and data manipulation, facilitated various matrix operations and numerical tasks.
  4. Scikit-Learn:

    • Scikit-Learn was employed for developing, training, and evaluating machine learning models, including the Gradient Boosting Classifier.
  5. Matplotlib and Seaborn:

    • Matplotlib and Seaborn were used for data visualization, aiding in understanding and presenting the data during the exploratory data analysis (EDA) phase.
  6. Streamlit:

    • Streamlit was utilized to create a live web application. It provides a user-friendly interface for efficient and rapid development.Streamlit Website
  7. Joblib:

    • Joblib was chosen for saving and loading models, a crucial aspect for using the model in a live environment and managing deployment processes.
  8. Evident AI:

    • Evidently AI was employed to monitor and evaluate the model's performance continuously. This ensures ongoing assessment of the model's effectiveness in a live setting.I imported some monitoring metrics and dashboard using evidently ai with streeamlit shairng.(Evident ai has own cloud too)

Project Components

  1. Streamlit App (app.py):

  2. Monitoring with Evident AI:

  3. Classification and Clustering Models:

    • Developed classification models to predict churn.
    • Explored clustering models to understand customer segmentation.
  4. Data Cleaning and Preprocessing:

    • Cleaned and preprocessed the dataset to handle outliers and improve model accuracy.

File Structure

  • app.py: Streamlit web application for live predictions.
  • evidentlyai_monitoring.ipynb: Jupyter notebook for model monitoring using Evident AI.
  • project.ipynb: Jupyter notebook for classification models.
  • project.ipynb: Jupyter notebook for clustering models.
  • gbm_production_model.joblib: Save and use machine learning model.
  • gbm_model_prediction.py:Predict production model on your local.
  • gbm.py:Predict basic model to predict local with all features.
  • project.pdf:You can find main project with pdf format too.
  • view.pdf:My reports and my ideas eith pdf format
  • assets/html:This files are exported by Evident AI.

How to Download and Run

  1. Clone the project repository to your computer:
  • git clone https://github.com/nursena8/BankCustomerProject.git

2.Install depndecies

  • pip install -r requirements.txt
  1. Run the streamlit app
  • streamlit run app.py

HTML Files

The following HTML files are required for the project to function properly:

  1. assets/class_report.html: This html created by evident ai show us classification reports.
  2. assets/report.html: This html created by evidently library using Jpyter notebook shows us dataframe summary.
  3. assets/data_quality_report.html:this html created by evidently using Jupyter notebook shows us dataset correlatio n.

Streamlit Application

[MY streamlit Website :)] (https://bankcustomerproject-4feyynfr99jzzpcegoeuq7.streamlit.app/)

To start the Streamlit application, follow these steps:

  1. Install the Streamlit application:
    • !pip install streamlit
  2. Run your streamlit project:
    • streamlit run app.py
  3. Go your port that you defineded

Deploy with Streamlit sharing

  1. I created app.py and run in my local.

  2. linked with github and created a repo to linked and deploy app.

    -Note: Don't give up Your app running on your local but deployment has some errors like version,packet downloads,moduleNotFound error.

    • You can Look streamlit app logs and can fix problems with stackoverflows easly.

      Ekran Resmi 2024-01-24 11 26 41

Deploy with Docker

  1. I created dockerfile.
  2. run docker build -t my-streamlit-app .
  3. run docker run -p 8501:8501 my-streamlit-ap
  4. http://localhost:8501

Our project overview

Evident ai

1.Install evidentlu !pip install evidently 2. Import evidently 3. Monitor model performance metrics and useful data dashboards

Future Work

  1. Continuous Improvement:

    • Plan for continuous model improvement based on ongoing monitoring and feedback.
  2. Additional Features:

    • Explore the incorporation of new features for enhanced predictive power.
  3. Advanced Models:

    • Investigate the implementation of advanced machine learning models for further accuracy.
  4. Feedback Mechanism:

    • Establish a feedback mechanism for customers to provide insights into their preferences.

License

This project has MIT License

Owner

Nursena Baykir

Would you like to Ask me anything?

Thank you for your consideration.