Starter Guide to Linear Regression (Part 1)

Starter Guide to Linear Regression (Part 1)

In this series we are going to explore the most basic yet powerful form of regression called Simple linear Regression but before we move on to what is‌‌simple linear regression and how does it work, it’s very important to understand what's regression and what does it helps us achieve.

Regression is a type of supervised learning technique which comes under the realm of Machine learning. Supervised learning in machine learning is the area which deals with the problems which have both predictor(s) as well as an output variable.

Now coming on to Regression, "Regression helps us with those problems where the output variable which we are trying to estimate or predict is of continuous in nature like price or temperature."

Understanding Straight Lines to Understand SLR

Continuous, What?

To understand what continuous variable means let’s explore price variable. Price can take a value of \$5.19 and it can also take a value of \$5.1952 and similarly can take infinitely many more values thus making it continuous in nature.

Another category of variable is discrete or categorical variable like gender or employment status. Let's explore gender, there are only 3 possible values for gender Male or Female or Transgender and that's it, any other value will be invalid for Gender. So, any variable (or feature) which can only choose the value from a finite set of options is called as discrete variable.

Alright, So what's Simple Linear Regression?

Simple linear Regression is one of the methods used to solve a regression problem. But we need to be careful as not all the regression problems can be efficiently solved using it and we might need the help of other regression techniques.

However that's a topic for another day. Talking about Simple linear Regression, it helps us with those problems which has only one predictor (or independent variable) and a continuous target variable. To work with multiple predictors (or features) we use something called Multiple linear Regression which is a similar technique.

To have a solid grasp of Simple Linear Regression we need to understand how straight lines work.

Let's discuss the image shown above to understand the basic workings and terminologies of straight lines. A straight line is a boundary in a 2-Dimensional plane like shown in the image and there can be infinite number of straight lines in a plane.

Each straight line in the plane can be represented by a equation of the form Y = mx + c.