Train logistic regression using hyperparameters