An end-to-end machine learning project for predicting salaries based on demographic and educational features.
-
Exploratory Data Analysis (EDA)
Generates visualization plots:
salary_distribution.png
correlation_matrix.png
salary_by_gender.png
salary_by_phd.png
pairplot.png
-
Train Models
Trains and compares:
- Linear Regression
- Polynomial Regression (Degree 2)
Saves the best model as best_model.pkl
-
Make Predictions
Interactive script for making salary predictions
-
Evaluate Model
Generates comprehensive evaluation metrics and visualizations
-
🌐 Web Interface (Recommended)
Opens interactive web application at http://localhost:8501
Features:
- Modern gradient UI design
- Interactive sliders and dropdowns
- Real-time salary predictions
- Percentile and comparison metrics
- Interactive Plotly visualizations
- Responsive layout
archive (3)/
├── Salary.csv # Dataset
├── eda.py # Exploratory data analysis
├── train_model.py # Model training pipeline
├── train_model_advanced.py # Advanced training (7 models)
├── evaluate_model.py # Model evaluation
├── inference.py # Prediction script
├── app.py # 🌐 Web interface (Streamlit)
├── requirements.txt # Dependencies
├── README.md # Documentation
└── best_model.pkl # Saved model
1# Input
2Gender: 1 (Male)
3Age: 45
4PhD: 1 (Yes)
5
6# Output
7Predicted Salary: 75,320.00