This repository contains a machine learning project aimed at predicting whether a bank customer will leave the bank or not using churn modelling techniques based on an Artificial Neural Network (ANN). The dataset includes 13 features, out of which 12 are independent variables and 1 is the dependent variable.
The dataset used for this project is churn_modelling.csv, which includes the following features:
- RowNumber: A unique identifier for each row.
- CustomerId: Unique identifier for each customer.
- Surname: Customer's surname.
- CreditScore: Credit score of the customer.
- Geography: Customer's country.
- Gender: Customer's gender.
- 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 bank products the customer uses.
- HasCrCard: Whether the customer has a credit card (1 for yes, 0 for no).
- IsActiveMember: Whether the customer is an active member (1 for yes, 0 for no).
- EstimatedSalary: Estimated salary of the customer.
- Exited: Whether the customer exited the bank (1 for yes, 0 for no).
The main objective of this project is to build an Artificial Neural Network model that can predict whether a bank customer will churn (leave) based on the provided features.
- Data Preprocessing:
- Handling missing values.
- Encoding categorical variables (One-Hot Encoding for Geography and Gender).
- Feature scaling if necessary.
- Exploratory Data Analysis (EDA):
- Understanding the distribution of variables.
- Detecting outliers.
- Visualizing relationships between variables.
- Model Building:
- Splitting the dataset into training and testing sets.
- Designing and training an Artificial Neural Network model.
- Evaluating model performance using appropriate metrics (e.g., accuracy, precision, recall, F1-score).
- Model Selection:
- Tuning hyperparameters if necessary.
- Choosing the best performing ANN model based on evaluation metrics.
- Model Deployment:
- Deploying the chosen ANN model for real-time predictions.
To replicate the analysis, follow these steps:
- Clone this repository to your local machine.
- Install the required dependencies listed in
requirements.txt
. - Run the Jupyter notebook
Churn_Modelling_Prediction.ipynb
to execute the code and follow the step-by-step analysis. - To install all the necessary files and libraries required to run this script, please execute the following command : pip install -r requirements.txt
The results of the analysis, including model performance metrics and insights gained from EDA, can be found within the Jupyter notebook.