{"id":28209739,"url":"https://github.com/45harry/customer_churn_predictor_using_ann","last_synced_at":"2025-06-10T21:31:51.691Z","repository":{"id":280796413,"uuid":"943196699","full_name":"45Harry/Customer_Churn_predictor_using_ANN","owner":"45Harry","description":"The Churn predictor model  designed using Neural Net . It takes age,salary etc as input and predicts weather the person will leave or not","archived":false,"fork":false,"pushed_at":"2025-03-05T10:24:42.000Z","size":324,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T16:15:09.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/45Harry.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-05T10:14:51.000Z","updated_at":"2025-03-05T10:24:46.000Z","dependencies_parsed_at":"2025-03-05T11:28:12.946Z","dependency_job_id":"49aac68a-2517-4c41-88b1-8c9ab500b819","html_url":"https://github.com/45Harry/Customer_Churn_predictor_using_ANN","commit_stats":null,"previous_names":["45harry/customer_churn_predictor_using_ann"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCustomer_Churn_predictor_using_ANN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCustomer_Churn_predictor_using_ANN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCustomer_Churn_predictor_using_ANN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCustomer_Churn_predictor_using_ANN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/45Harry","download_url":"https://codeload.github.com/45Harry/Customer_Churn_predictor_using_ANN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/45Harry%2FCustomer_Churn_predictor_using_ANN/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259154413,"owners_count":22813598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-17T16:13:15.733Z","updated_at":"2025-06-10T21:31:51.680Z","avatar_url":"https://github.com/45Harry.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customer Churn Prediction Using Neural Networks\n\n## About\n\nThis project focuses on predicting customer churn (whether a customer will leave or stay with the company) using a deep learning model. The dataset contains various features about customers, including demographic details, account information, and service usage. The goal is to train a neural network model to classify whether a customer will churn (Exited = 1) or not (Exited = 0).\n\nThe model uses a fully connected neural network (also known as a dense network) built with TensorFlow and Keras. The project also includes data preprocessing, exploratory data analysis (EDA), and evaluation using various metrics like accuracy, F1-score, and confusion matrix.\n\n## Dataset\n\nThe dataset used for this project is `Churn_Modelling.csv`, which contains the following columns:\n\n- `RowNumber`: Row number in the dataset (not relevant for prediction)\n- `CustomerId`: Unique customer ID (not relevant for prediction)\n- `Surname`: Customer's surname (not relevant for prediction)\n- `CreditScore`: Credit score of the customer\n- `Geography`: The country where the customer is located (France, Germany, Spain)\n- `Gender`: Gender of the customer (Male/Female)\n- `Age`: Age of the customer\n- `Tenure`: Number of years the customer has been with the company\n- `Balance`: Customer's account balance\n- `NumOfProducts`: Number of products the customer has purchased\n- `HasCrCard`: Whether the customer has a credit card (1 = Yes, 0 = No)\n- `IsActiveMember`: Whether the customer is an active member (1 = Yes, 0 = No)\n- `EstimatedSalary`: Estimated annual salary of the customer\n- `Exited`: Target variable (1 = Churned, 0 = Stayed)\n\n## Features\n\n- **Data Preprocessing**: Cleaned the dataset by removing irrelevant columns, handling categorical features (`Gender`, `Geography`), and scaling continuous variables (`Balance`, `EstimatedSalary`).\n- **Exploratory Data Analysis (EDA)**: Visualized customer tenure and salary distributions to gain insights into how they relate to churn.\n- **Model**: Built a fully connected neural network model with two hidden layers using TensorFlow/Keras.\n- **Model Evaluation**: Evaluated the model using accuracy, precision, recall, F1-score, and confusion matrix.\n\n## Project Structure\n\n```plaintext\n.\n├── Churn_Modelling.csv       # The dataset used for training\n├── churn_prediction_model.py # Python script with data preprocessing, model creation, and evaluation\n└── README.md                 # This README file\n```\n\n## Requirements\n\nTo run this project, you will need to install the following libraries:\n\n- Python 3.x\n- TensorFlow\n- pandas\n- matplotlib\n- scikit-learn\n- seaborn\n\nYou can install the dependencies using pip:\n\n```bash\npip install tensorflow pandas matplotlib scikit-learn seaborn\n```\n\n## Usage\n\n### Step 1: Load the dataset\nThe `Churn_Modelling.csv` dataset should be available in the same directory as the script.\n\n### Step 2: Preprocess the data\nThe dataset is cleaned by:\n- Removing irrelevant columns.\n- Encoding categorical columns (`Gender`, `Geography`).\n- Scaling numerical features.\n\n### Step 3: Split the data\nThe dataset is split into training and test sets, with a stratified split to ensure equal distribution of the target variable (`Exited`).\n\n### Step 4: Train the model\nA deep neural network model is built using TensorFlow's Keras API, with the following architecture:\n- Input layer (12 features)\n- 2 hidden layers (100 units each, ReLU activation, Batch Normalization)\n- Output layer (1 unit, sigmoid activation)\n\nThe model is compiled using the `adam` optimizer and `binary_crossentropy` loss function.\n\n### Step 5: Model Evaluation\nThe model is trained for 100 epochs. After training, the model's performance is evaluated on the test set using metrics like accuracy, precision, recall, F1-score, and the confusion matrix.\n\n### Step 6: Visualization\nA confusion matrix heatmap is displayed using Seaborn to visualize the true vs. predicted churn values.\n\n## Results\n\nAfter training the model, the performance metrics (accuracy, precision, recall, and F1-score) provide a clear understanding of how well the model is performing. The confusion matrix also highlights the misclassifications made by the model (false positives and false negatives).\n\n## Potential Improvements\n\n- **Handling Class Imbalance**: Use techniques such as oversampling the minority class or adjusting class weights to handle the class imbalance in the dataset.\n- **Hyperparameter Tuning**: Perform grid search or random search for hyperparameter optimization to improve model performance.\n- **Alternative Models**: Try other machine learning models (e.g., Random Forest, XGBoost, Logistic Regression) and compare performance.\n\n## License\n\nThis project is licensed under the MIT License.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F45harry%2Fcustomer_churn_predictor_using_ann","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F45harry%2Fcustomer_churn_predictor_using_ann","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F45harry%2Fcustomer_churn_predictor_using_ann/lists"}