Skip to content

Customer Churn Prediction πŸ“‰: A machine learning project that predicts customer churn using a neural network with TensorFlow and Keras πŸ€–. Includes data preprocessing 🧹, feature engineering πŸ”§, and model evaluation πŸ“Š with tools like Pandas, scikit-learn, and Matplotlib πŸ“ˆ.

Notifications You must be signed in to change notification settings

shubhamdeepkeshav/Customer-Churn-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Customer Churn Prediction πŸ“Š

Overview This project focuses on predicting customer churn using machine learning. It involves data preprocessing, model training, and evaluation to identify customers likely to churn. The model is built with TensorFlow and Keras, while data manipulation and visualization are handled using Pandas, scikit-learn, and Matplotlib.

πŸ“‹ Table of Contents

β€’	Overview
β€’	Technologies Used
β€’	Setup
β€’	Data
β€’	Model
β€’	Evaluation
β€’	Usage
β€’	Contributing
β€’	License

πŸ”§ Technologies Used

β€’	TensorFlow 🧠: For building and training the neural network model.
β€’	Keras πŸ—οΈ: High-level API for creating neural network layers.
β€’	Pandas πŸ“Š: Data manipulation and preprocessing.
β€’	scikit-learn πŸ”¬: For model evaluation and metrics.
β€’	Matplotlib πŸ“ˆ: For visualizing data and evaluation metrics.
β€’	Seaborn 🌈: For enhanced data visualization.

βš™οΈ Setup

Prerequisites Install the required Python packages:

pip install tensorflow numpy pandas scikit-learn seaborn matplotlib

Data πŸ“‚

The dataset includes customer details such as:

β€’	Tenure

β€’	Monthly Charges

β€’	Customer Service Features

🧠 Model

A neural network model with the following architecture:

β€’ Input Layer: Dense layer with 26 neurons, ReLU activation function.

β€’ Hidden Layer: Dense layer with 15 neurons, ReLU activation function.

β€’ Output Layer: Dense layer with 1 neuron, Sigmoid activation function.

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

model = Sequential([
  Dense(26, input_shape=(26,), activation='relu'),
  Dense(15, activation='relu'),
  Dense(1, activation='sigmoid')
  ])

πŸ“ˆ Evaluation

The model is evaluated using:

β€’ Confusion Matrix: To visualize model performance.

β€’ Classification Report: Provides precision, recall, and F1-score metrics.

from sklearn.metrics import confusion_matrix, classification_report

import seaborn as sns

import matplotlib.pyplot as plt

Assuming yp contains predictions and y_test contains actual values

cm = confusion_matrix(y_test, y_pred)
plt.figure(figsize=(10, 7))
sns.heatmap(cm, annot=True, fmt='d', cmap='Blues')
plt.xlabel('Predicted')
plt.ylabel('Truth')
plt.title('Confusion Matrix')
plt.show()

print(classification_report(y_test, y_pred))

πŸƒβ™‚οΈ Usage

To train and evaluate the model, run:

python main.py

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository 🍴

  2. Create a new branch (git checkout -b feature-branch) 🌿

  3. Commit your changes (git commit -am 'Add new feature') πŸ“

  4. Push to the branch (git push origin feature-branch) πŸš€

  5. Create a Pull Request πŸ’¬

About

Customer Churn Prediction πŸ“‰: A machine learning project that predicts customer churn using a neural network with TensorFlow and Keras πŸ€–. Includes data preprocessing 🧹, feature engineering πŸ”§, and model evaluation πŸ“Š with tools like Pandas, scikit-learn, and Matplotlib πŸ“ˆ.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published