Linear Regression is a method used to define a relationship between a dependent variable (Y) and an independent variable (X)…