linear regression implementation in python from scratch