Linear regression from scratch using QR decomposition

You can make your code legible by surrounding it with a triple backtick fence. And if you add just a bit of information your question will be self-contained so we can try running your code.