Linear regression makes predictions for continuous/real or numeric variables such as sales, salary, age, product price, etc. Linear regression performs the task to predict a dependent variable value (y) based on a given independent variable (x). So, this regression technique finds out a linear relationship between x (input) and y(output)…