Skip to content

mooginiharika/Salary-Predictor

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฐ Advanced Salary Prediction Web App

๐Ÿš€ AI-Powered Salary Insights for the Modern Workforce

Python Streamlit Scikit-learn License

๐ŸŽฏ 91.8% Accuracy | ๐Ÿ“Š Advanced ML Model | ๐ŸŒ Interactive Web Interface


๐ŸŒŸ Overview

Welcome to the Advanced Salary Prediction Web App - a cutting-edge machine learning application that predicts salaries with remarkable 91.8% accuracy! Built using state-of-the-art Gradient Boosting algorithms, this app provides data-driven salary insights for professionals across various industries.

โœจ Key Highlights

  • ๐Ÿง  Advanced ML Model: Gradient Boosting with optimized hyperparameters
  • ๐Ÿ“ˆ High Accuracy: 91.8% prediction accuracy on test data
  • ๐ŸŽจ Interactive UI: Beautiful Streamlit-powered web interface
  • ๐Ÿ“Š Rich Visualizations: Comprehensive data analysis and insights
  • ๐Ÿ” Feature Analysis: Detailed breakdown of salary-influencing factors
  • ๐Ÿ’ก Smart Predictions: Confidence intervals and key factor explanations

๐ŸŽฏ Model Performance

Our advanced machine learning model delivers exceptional results:

๐Ÿ† Best Model: Gradient Boosting Regressor
๐Ÿ“Š Test Accuracy: 91.8%
๐Ÿ“‰ Generalization Gap: 0.0451
๐ŸŽฏ RMSE: $11,434
๐Ÿ“ MAE: $9,238

๐Ÿ“ˆ Performance Metrics

  • Training Rยฒ: 0.9636
  • Test Rยฒ: 0.9185
  • Low Overfitting: Excellent generalization capability
  • Robust Predictions: Consistent across different salary ranges

๐Ÿš€ Quick Start

Prerequisites

1๏ธโƒฃ Clone the Repository

git clone https://github.com/yourusername/salary-predictor.git
cd salary-predictor

2๏ธโƒฃ Create Virtual Environment

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

3๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

4๏ธโƒฃ Launch the Web App

streamlit run app.py

๐ŸŽ‰ That's it! The app will open in your browser at http://localhost:8501


๐Ÿ“‚ Project Structure

salary-predictor/
โ”œโ”€โ”€ ๐Ÿ“Š data/
โ”‚   โ””โ”€โ”€ Salary_Data.csv              # Training dataset
โ”œโ”€โ”€ ๐Ÿง  models/
โ”‚   โ”œโ”€โ”€ salary_prediction_model.joblib    # Trained ML model
โ”‚   โ”œโ”€โ”€ model_metadata.json              # Model configuration
โ”‚   โ””โ”€โ”€ visualization_data.json          # Visualization data
โ”œโ”€โ”€ ๐Ÿ“ˆ visualizations/                    # Generated plots and charts
โ”œโ”€โ”€ ๐ŸŒ app.py                            # Main Streamlit application
โ”œโ”€โ”€ ๐Ÿ”ง salary_model_api.py               # Model API and utilities
โ”œโ”€โ”€ ๐Ÿ“‹ requirements.txt                   # Python dependencies
โ”œโ”€โ”€ ๐Ÿ“– README.md                         # This file
โ””โ”€โ”€ ๐ŸŽฏ .gitignore                        # Git ignore file

๐Ÿ’ป Features

๐Ÿ”ฎ Salary Prediction

  • Real-time Predictions: Get instant salary estimates
  • Confidence Intervals: Understand prediction reliability
  • Range Estimates: Min-max salary ranges for better planning

๐Ÿ“Š Data Insights

  • Feature Importance: See what factors matter most
  • Correlation Analysis: Understand relationships between variables
  • Interactive Visualizations: Explore data through beautiful charts

๐ŸŽฏ Key Factors Analyzed

  • Years of Experience (30.8% impact)
  • Age (22.4% impact)
  • Education Level (10.4% impact)
  • Job Title
  • Gender
  • Industry Specifics

๐Ÿ“Š Sample Predictions

๐Ÿ‘จโ€๐Ÿ’ป Senior Software Engineer

  • Predicted Salary: $152,670
  • Confidence Range: $144,506 - $160,833
  • Key Factors: Master's degree, 8+ years experience

๐Ÿ‘ฉโ€๐Ÿ”ฌ Junior Data Scientist

  • Predicted Salary: $82,826
  • Confidence Range: $74,663 - $90,990
  • Key Factors: High-demand role, growth potential

๐Ÿ‘จโ€๐Ÿ’ผ Experienced Manager

  • Predicted Salary: $217,888
  • Confidence Range: $209,725 - $226,052
  • Key Factors: Leadership role, extensive experience

๐Ÿ› ๏ธ Technical Details

Machine Learning Pipeline

  1. Data Preprocessing: Feature engineering and cleaning
  2. Model Selection: Comprehensive algorithm comparison
  3. Hyperparameter Tuning: Grid search optimization
  4. Validation: Cross-validation and performance testing
  5. Deployment: Streamlit web interface

Model Architecture

GradientBoostingRegressor(
    learning_rate=0.1,
    max_depth=5,
    min_samples_split=20,
    n_estimators=150,
    subsample=0.8
)

Dataset Statistics

  • Average Salary: $135,375
  • Salary Range: $67,247 - $234,803
  • Sample Size: Comprehensive professional dataset
  • Features: Age, Experience, Education, Job Title, Gender

๐Ÿ“‹ Requirements

pandas>=1.5.3
numpy>=1.23.5
scikit-learn>=1.2.2
scipy>=1.10.1
matplotlib>=3.6.3
seaborn>=0.12.2
plotly>=5.14.1
joblib>=1.2.0
streamlit>=1.22.0

๐ŸŽจ Screenshots & Demos

๐Ÿ–ฅ๏ธ Main Interface

Beautiful, intuitive web interface for salary predictions

๐Ÿ“Š Data Visualizations

Interactive charts showing salary distributions and correlations

๐Ÿ” Prediction Results

Detailed prediction breakdown with confidence intervals


๐Ÿš€ Deployment Options

Local Development

streamlit run app.py

Streamlit Cloud

  1. Push to GitHub
  2. Connect to Streamlit Cloud
  3. Deploy with one click

Docker Deployment

FROM python:3.11-slim
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
EXPOSE 8501
CMD ["streamlit", "run", "app.py"]

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/AmazingFeature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/AmazingFeature)
  5. ๐Ÿ”„ Open a Pull Request

Ideas for Contribution

  • ๐ŸŽจ UI/UX improvements
  • ๐Ÿ“Š Additional visualization features
  • ๐Ÿง  Model performance enhancements
  • ๐Ÿ“ฑ Mobile responsiveness
  • ๐ŸŒ Multi-language support

๐Ÿ“ˆ Future Enhancements

  • ๐Ÿ”„ Real-time data updates
  • ๐ŸŒ Geographic salary variations
  • ๐Ÿ“ฑ Mobile app development
  • ๐Ÿค– Advanced AI features
  • ๐Ÿ“Š Industry-specific models
  • ๐Ÿ” User authentication system

๐Ÿ› Troubleshooting

Common Issues

Issue: ModuleNotFoundError

# Solution: Ensure virtual environment is activated
pip install -r requirements.txt

Issue: Port already in use

# Solution: Use different port
streamlit run app.py --server.port 8502

Issue: Model file not found

# Solution: Ensure models directory exists
mkdir models
# Re-run training script if needed

๐Ÿ“ž Support & Contact


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • ๐Ÿ“š Scikit-learn team for the amazing ML library
  • ๐ŸŽจ Streamlit for the beautiful web framework
  • ๐Ÿ“Š Plotly for interactive visualizations
  • ๐Ÿค Open Source Community for inspiration and support

๐ŸŒŸ Star this repository if you found it helpful! ๐ŸŒŸ

Made with โค๏ธ and lots of โ˜•

โฌ† Back to Top

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%