5. Implement Linear Regression from Scratch:
Implement a Linear Regression from scratch. Implement a loss function (squared loss) and implement a very simple gradient descent algorithm in python. Test your implementation on the house price prediction dataset from the demo on Linear Regression. Finally, compare your solution to the solution obtained by sklearn (from the demo) and comment on it briefly. You do not need to consider the more complicated quadratic case. Just the simple linear regression on the features is enough for this.
You can use sklearn to load the dataset and do the splits but not do anything more (e.g., form the
loss function, optimize it, or directly call linear regression from sklearn – you will be comparing to it
but you should compare your implementation to sklearn’s implementation.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.