Finish simple logistic regression optimization.

Add ml code.