Django Club

Salary Prediction

Using Elastic Net Regression Model

After submitting the form, wait at least 10 seconds for the model to calculate and show the result.

Model Description:

Regression is a supervised machine learning method for understanding the relationship between independent variables or features and a dependent variable or outcome. One of the algorithms used for regression is the “Elastic Net Regression”.
Here, we use the salaries.csv dataset for regression purposes and you can download the dataset from the link on top of this page.
This dataset has 2 features: “Age” and “Job
And the prediction variable is: “Salary”.
In the above form, you enter the values of 2 features and the model returns the Salary in a pop-up form. As 1 feature of our dataset is Categorical and another one is Numerical, for using Elastic Net Regression for this mixed dataset, we need to convert categorical feature to numerical label and then we could use the Elastic Net Regression method.
Notice that the values and ranges of each feature are as below:

23 < Age < 65
Job (0 → Accountant , 1 → Dentist, 2 → High School Teacher, 3 → Software Engineer)
4000 < Salary < 24100
The sample code used to train a “Elastic Net Regression” model, is provided in the link on top of this page. Each time you run this form and predictions happen, the values will store in the database, and with the link “result” on top of this page, you will see the previous results of the model prediction. Your recent run will be added to the end of this list.