
X = X - coordinate of the point from which line passes through Y = Y - coordinate of the point from which line passes through When we have two given points in a coordinate plane we can always find the equation of line passing through the two points. Now after pensive thinking Patrick was able to predict the selling price for Squidward’s house. (From the collected data Patrick was able to draw the following graph.) Now here notice that the actual price of the house is dependent on various factors like:īut since this is simple linear regression and it’s the first tutorial so we are just going to consider the area of the house as an independent variable to calculate the price of the dependent variable price of the house. After some time they were able to find out the square footage and selling price of their houses.) (They decided to go to Squidward’s neighbourhood, where his two neighbours recently sold their houses. Patrick: “That’s a piece of cake, my friend! Follow me!” (SpongeBob described the whole situation to Patrick.)

(Patrick is in his living room watching TV with a big bowl of popcorn in his hands.) To discuss the problem he went to his shrewd friend Patrick’s house.) (SpongeBob is stressed as always but he’s very optimistic about finding the solution. But I can’t figure out at which price I should sell my house! If I keep the price too high then no one is going to buy it and if I set the price low then I might face tremendous financial loss! So you have to help me find the best price for my house. I want to sell my house as I’m going to shift to my new lavish house in downtown. SpongeBob: “Yes sir! There is no doubt in that.” Squidward: “Hey SpongeBob I’ve heard you’re so smart!” One day Squidward went to SpongeBob and had this conversation. Let’s say there lived some friends named SpongeBob, Patrick, Squidward and Gary in the “Bikini Bottom!”. To see when we are going to need to use Simple Linear Regression, why don’t we start with a story of some friends! So here we can say that the output variable is dependent on the input data, that’s why it’s called a dependent variable. We build machine learning models to predict a variable based on the input data.

The dependent variable is also called the output variable. So, the variables in the dataset which we are going to use to build a model are called independent variables. If we want to create a machine learning model then we must have some dataset, based on which we will predict the value of output. Independent variable is also called an input variable. Regression analysis is a set of statistical approaches that are used to determine the relationships between the dependent variable(output) and the independent variable(input).

Before we hop into the derivation of simple linear regression, it’s important for us to have a very strong intuition on what we are actually going to do and especially why we are going to do it? With that being said, let’s dive in!
