Linear regression from scratch using QR decomposition

I think this has been discussed as extensively as possible here:

1 Like