Training the logistic regression