Training a logistic regression model using stochastic gradient descent