An open API service indexing awesome lists of open source software.

https://github.com/sayande01/customer_churn_dnn

A Python project to predict customer churn using a neural network. Includes data preprocessing, exploratory analysis, and a TensorFlow-based model for binary classification. Ideal for understanding churn behavior and building predictive solutions.
https://github.com/sayande01/customer_churn_dnn

deep-learning neural-network

Last synced: 2 months ago
JSON representation

A Python project to predict customer churn using a neural network. Includes data preprocessing, exploratory analysis, and a TensorFlow-based model for binary classification. Ideal for understanding churn behavior and building predictive solutions.

Awesome Lists containing this project

README

        

# Customer Churn Prediction Using Neural Networks

This repository contains a Python project for predicting customer churn using a neural network. It utilizes a dataset of customer information, cleans and preprocesses the data, and applies a TensorFlow-based neural network model to classify churn probability.

---

## Table of Contents
- [Project Overview](#project-overview)
- [Dataset](#dataset)
- [Technologies Used](#technologies-used)
- [Project Workflow](#project-workflow)
- [Model Architecture](#model-architecture)
- [Installation](#installation)
- [Usage](#usage)
- [Results](#results)
- [Contributing](#contributing)
- [License](#license)

---

## Project Overview
Customer churn is a critical metric for businesses, especially subscription-based services. This project aims to predict churn based on customer data using a machine-learning approach.

The project workflow includes:
1. Exploratory Data Analysis (EDA) for data understanding.
2. Data preprocessing to clean and prepare the dataset.
3. Building and training a neural network to classify churn outcomes.
4. Evaluating model performance to ensure accuracy and reliability.

---

## Dataset
The dataset used for this project contains customer information such as:
- **Demographics**: Gender, SeniorCitizen, Partner, Dependents.
- **Services**: PhoneService, MultipleLines, InternetService, StreamingTV, etc.
- **Account Information**: Tenure, Contract Type, Payment Method, Monthly and Total Charges.
- **Churn**: Binary indicator of whether the customer has churned.

**Dataset Summary**:
- **Rows**: 7,043
- **Columns**: 21
- No missing or duplicate values were found.

---

## Technologies Used
- **Programming Language**: Python
- **Libraries and Frameworks**:
- Data Processing: `pandas`, `numpy`
- Visualization: `matplotlib`, `seaborn`
- Machine Learning: `TensorFlow`, `Keras`

---

## Project Workflow
1. **Data Loading and Cleaning**:
- Load the dataset.
- Handle missing values and incorrect data types.
2. **Exploratory Data Analysis**:
- Understand distributions and correlations.
- Visualize features affecting churn.
3. **Feature Engineering**:
- Normalize and encode categorical data.
- Prepare the dataset for neural network input.
4. **Model Building**:
- A 3-layer neural network with `relu` activation.
- Binary cross-entropy as the loss function.
5. **Training and Evaluation**:
- Train the model on the dataset for 100 epochs.
- Evaluate model accuracy and loss.

---

## Model Architecture
The neural network architecture:
- **Input Layer**: 23 features.
- **Hidden Layers**:
- First layer: 23 neurons, ReLU activation.
- Second layer: 15 neurons, ReLU activation.
- **Output Layer**: 1 neuron, Sigmoid activation.
- **Optimizer**: Adam with default learning rate.
- **Loss Function**: Binary Crossentropy.

---

## Usage
1. Prepare your dataset (`customer_churn.csv`).
2. Load the notebook or script.
3. Train the model using:
```python
model.fit(X_train, y_train, epochs=100)
```
4. Evaluate the model and use it to predict churn probabilities.

---

## Results
The model achieves **[Add Accuracy Here]%** accuracy after training for 100 epochs. Further optimization can be done by tuning hyperparameters or applying additional feature engineering.

---

## Contributing
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.