Logistic regression with gradient descent