How to Implement an Advanced Linear Regression from Scratch in Python Using Gradient Descent