In this code we solve the linear regression problem using 2 methods.
The first is build the model ourselves using the previously mentioned equations.
The second is using the sklearn library which has linear regression model in it to do it for us.
And from the results both models achieve similar accuracies (I used the Mean Absolute Error to compare both model's performance) but the sklearn one is much faster as it used other algorithms to optimise its calculations
For more information on the equations and how the code actually works please refer to the code itself