linear regression python code from scratch