Regularized logistic regression using gradient descent