Linear regression is basically a predictive analytics technique. Regression is used to understand and quantify cause-effect relationships. It helps us to understand relationship between dependent and independent variables. Example:- Simplest case we are trying to find is the relationship between baby and birth weight and gestation period.
Birth weight = f(gestation weeks)
- Where f is the functional form that we are trying to determine.
A linear relationship between two variables is essentially a straight line relationship.
mathematical equation that denotes a linear (straight line) relationship between two variables x and y is shown as below:
y = mx + c
where, m = slope & c = intercept
slope is the rate of change of Y when X changes Eg: Y=2+3x (intercept =2 , slope=3) => Y=2+3(1) => Y=5
for a unit change in X, Y changes by a constant amt. 3 in the above case.
When we keep intercept as zero, than we will have same line but it passes through the origin.