The Salary Calculation App predicts employee salaries using machine learning algorithms, specifically polynomial regression. This application analyzes salary data correlations to provide accurate salary predictions based on experience levels.
- Predicts employee salaries based on experience level.
- Utilizes polynomial regression for better accuracy.
- User-friendly interface for inputting experience levels.
- Visual representation of actual vs. predicted salaries.
To run this application, you need the following Python packages:
pandasnumpymatplotlibscikit-learn
Install the required packages using pip:
pip install pandas numpy matplotlib scikit-learn- Clone the repository or download the salary_calculation.py file.
- Ensure the salaries_dataset.csv file is in the same directory as the script.
- Run the application:
python salary_calculation.py
- Enter the experience level of the employee when prompted.
- The application will display the predicted salary and plot the results.
The application uses a dataset named salaries_dataset.csv, which should contain:
- experience_level: Numeric values representing years of experience.
- salary: Numeric values representing corresponding salaries.
| Experience Level | Salary ($) |
|---|---|
| 1 | 4,500 |
| 2 | 5,000 |
| 3 | 6,000 |
| 4 | 8,000 |
| 5 | 11,000 |
| 6 | 15,000 |
| 7 | 20,000 |
| 8 | 30,000 |
| 9 | 50,000 |
| 10 | 100,000 |
Calculating each employee's salary based on experience level can be tedious, especially when the relationship is non-linear. In this project, this project deals with a machine learning model that leverages polynomial regression, an effective model given that most salary structures are polynomial.
Most companies have a non-linear salary structure, where salary growth is exponential rather than linear. Polynomial regression allows us to model these non-linear relationships accurately.
The model is typically expressed as: Y = β0 +β1 X+β2 X^2 +⋯+βn X^n +ϵ
- Data Loading: Loads salaries_dataset.csv using pandas.
- Data Visualization: Creates a scatter plot to show the relationship between experience level and salary.
- Linear Regression Model: Tests a basic linear model, which proves insufficient for non-linear salary data.
- Polynomial Transformation: Uses PolynomialFeatures to transform experience data.
- Polynomial Regression Model: Fits a polynomial model to the transformed data.
- Prediction: Predicts salary for specific experience levels.
- Conclusion: Demonstrates that polynomial regression better suits the data than linear regression.
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Yash Mittal. Version 1.0