Python Stochastic Gradient Descent Algorithm