 ## Coding Linear Regression from Scratch | by Kumud Lakara | Jan, 2021

[ad_1]

This post follows the linear regression post in the ‘Basics and Beyond’ series so if you are just getting started with machine learning I would recommend going through that post first and then starting with this tutorial. If you already have an idea about what linear regression is then lets get started!

In this post we will be coding the entire linear regression algorithm from absolute scratch using python so we will really be getting our hands dirty today!

Let’s go!

The first step for any machine learning problem is getting the data. There is no machine “learning” if there is nothing to “learn” from. So for this tutorial we will be using a very common dataset for linear regression i.e. the house-price prediction dataset. The dataset can be found here.

This is a simple dataset containing housing prices in Portland, Oregon. The first column is the size of the house (in square feet), the second column is the number of bedrooms, and the third column is the price of the house. You might have noticed that we have more than one feature in our dataset (i.e. the house_size(in sqft) and the number of rooms) hence we will be looking at multivariate linear regression and the label (y) will be the house price as that is what we are going to be predicting.

Lets define the function for loading the dataset:

Read More …

[ad_2]