← Back to Portfolio

Employee Salary Prediction App (Regression & Streamlit)

This project demonstrates the core machine learning workflow, from data preparation and model training to deployment in a user-friendly web application. The goal was to build a simple Regression Model capable of predicting employee salary based on key features (age, experience, education, etc.).

It serves as a practical showcase for implementing and deploying a scikit-learn model using Streamlit, illustrating foundational MLOps concepts and front-end development using Python libraries.

Problem & Model Selection

  • Problem: Regression Analysis

    The task is to predict a continuous numerical value (salary) based on input features, making it a classic Regression Problem.

  • Model: Linear Regression

    A Linear Regression model (trained using scikit-learn) was chosen for its interpretability and effectiveness in demonstrating fundamental predictive modeling principles.

Technical Stack & Deployment

    Model & Data Processing
  • Python (Core language)
  • scikit-learn (Model training)
  • Pandas (Data loading and manipulation)
  • LabelEncoder (Handling categorical features like Job Title, Education)
  • Deployment & Architecture
  • Streamlit (Front-end web application framework)
  • Pickle (.pkl files) (Saving and loading the trained model and encoders)
  • MLOps Basics (Separation of model training and app serving logic)

Key Implementation Details

  1. Encoder Persistence

    Ensured the `LabelEncoder` used for transforming categorical data was saved (`encoders.pkl`) alongside the model, guaranteeing consistent prediction input during deployment.

  2. Streamlit UI Design

    The front-end (`app.py`) was designed with Streamlit to offer a clean, interactive dashboard where users can input parameters using sliders and dropdown menus for immediate salary estimation.

  3. Modular Code Structure

    The project uses distinct files (`model_train.py`, `model.py`, `app.py`) for training, loading, and serving, which is a key practice for scalable MLOps.

Source Code & Usage

Review the Python code and model files, or learn how to run the application locally using Streamlit:

View Project Repository

Local Execution Command:

git clone https://github.com/sinister-virus/employee-salary-prediction-streamlit.git
pip install -r requirements.txt
streamlit run app.py