Source: Deep Learning on Medium

*2. Mathematics behind the model:*

Even though we have python libraries which can do the regression analysis in a single line of code, it is really important to know the mathematics behind the model. Because only when you know how a model works from the scratch, you will be able to tweak different model parameters with respect to your problem statement and the dataset at your hand to get the desired result.

There are two kinds of variables in a linear regression model:

- The
*input**independent**predictor***X**. - The
*output**dependent***Y**.

**2.1 Simple linear regression:**

When there is one input variable/independent variable (X) then it is called simple linear regression.

The simple linear regression equation looks like this: