A machine learning project that predicts a bank customer's estimated salary based on their demographic and account information. This project features an ANN regression model built with TensorFlow/Keras and deployed as an interactive web application using Streamlit.
🔴 Live Demo: Click here to use the App
The goal of this project is to build a regression model that can estimate a user's salary based on standard banking data points. It demonstrates the end-to-end process of data preprocessing, model training, and deployment.
Key Features:
- Deep Learning Model: An Artificial Neural Network (ANN) regressor trained on the Churn Modelling dataset.
- Web Interface: A user-friendly Streamlit app for real-time predictions.
- Preprocessing Pipeline: Automated handling of categorical data (Label Encoding & One-Hot Encoding) and feature scaling.
- Python (Programming Language)
- TensorFlow & Keras (Model Building)
- Pandas & NumPy (Data Manipulation)
- Scikit-learn (Data Preprocessing)
- Streamlit (Web Framework)
- Pickle (Model Persistence)
Salary-Estimation-Project/
│
├── venv/ # Virtual environment (do not track in git)
│
├── README.md # Project documentation
├── requirements.txt # List of python libraries needed
│
├── Churn_Modelling.csv # The dataset
├── salaryregression.ipynb # Notebook used to train the model
├── app.py # The Streamlit web application
│
├── # --- Generated Files (Created after running the notebook) ---
├── regression_model.h5 # The trained ANN model
├── salary_scaler.pkl # Saved Standard Scaler
├── salary_gender_encoder.pkl # Saved Label Encoder
└── salary_geo_encoder.pkl # Saved One-Hot Encoder
-
Clone the repository:
git clone [https://github.com/yourusername/salary-estimation-ann.git](https://github.com/yourusername/salary-estimation-ann.git) cd salary-estimation-ann -
Create a virtual environment (Optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies:
pip install streamlit tensorflow pandas numpy scikit-learn
-
Train the Model (First time only): Run the
salaryregression.ipynbnotebook to preprocess the data, train the ANN, and save the necessary.h5and.pklfiles. -
Start the Streamlit App:
streamlit run app2.py
-
Access the App: Open your browser and go to
http://localhost:8501.
The ANN consists of:
- Input Layer: Matches the number of preprocessed features.
- Hidden Layers: Two dense layers with ReLU activation (64 and 32 neurons).
- Output Layer: Single neuron with linear activation (for regression output).
- Optimizer: Adam
- Loss Function: Mean Squared Error (MSE)
Use the sidebar/main panel in the web app to input:
- Geography (France, Germany, Spain)
- Gender
- Age, Tenure, Balance
- Credit Score, Number of Products
- Credit Card Status & Active Membership
Click "Estimate Salary" to see the predicted value.