Linear Regression Function Python Code