Skip to content

maanu-v/Salary_Prediction

Repository files navigation

Salary Prediction Tool

Salary Prediction Banner Python Machine Learning Streamlit

A machine learning application that predicts salaries based on personal and professional attributes such as age, gender, education level, job title, and years of experience.

📋 Table of Contents

🔍 Overview

This project uses a Random Forest Regression model to predict salaries based on various inputs. The application is built with a machine learning backend (scikit-learn) and a user-friendly frontend (Streamlit) for easy interaction.

The predictions are made in Indian Rupees (₹) and the model is trained on a dataset of professional attributes and corresponding salaries.

✨ Features

  • Machine Learning Model: Trained Random Forest Regressor for salary prediction
  • Hyperparameter Tuning: Uses GridSearchCV for model optimization
  • Data Preprocessing: Handles both numerical and categorical data
  • User-friendly Interface: Easy-to-use Streamlit web application
  • Visualizations: Display of model performance metrics
  • Instant Predictions: Real-time salary estimates based on user inputs

📁 Project Structure

/home/Maanu/Documents/Salary_Prediction/
│
├── model.py               # ML model training and evaluation code
├── app.py                 # Streamlit frontend application
├── requirements.txt       # Project dependencies
├── run.sh                 # Script to run the application
├── Salary Data.csv        # Training dataset
├── salary_prediction_model.pkl  # Saved trained model
├── actual_vs_predicted.png     # Model performance visualization
└── README.md             # Project documentation

🚀 Installation

Prerequisites

  • Python 3.8 or higher
  • Git

Step 1: Clone the Repository

git clone https://github.com/maanu-v/Salary_Prediction.git
cd Salary_Prediction

Step 2: Install Dependencies

Using pip:

pip install -r requirements.txt

Using uv (recommended for faster installation):

uv pip install -r requirements.txt

🖥️ Usage

Running the Application

  1. Make the run script executable:

    chmod +x run.sh
  2. Start the application:

    ./run.sh
  3. Access the web interface:

    • The application will automatically open in your default web browser
    • If not, visit http://localhost:8501

Using the Interface

  1. Enter your information in the form:

    • Age
    • Gender
    • Education Level
    • Job Title
    • Years of Experience
  2. Click "Predict Salary" to get an estimate

  3. View the prediction and model insights

🧠 Model Information

Dataset

The model is trained on a dataset with the following features:

  • Age
  • Gender
  • Education Level
  • Job Title
  • Years of Experience

Target variable:

  • Salary (in ₹)

Model Performance

The Random Forest Regressor model achieves:

  • R² Score: ~0.87 (may vary slightly with different runs)
  • Feature importance analysis is available in the app interface

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Made with ❤️ by Manasa

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published