Add grid search mode for logistic regression