added cg and l-bfgs for logistic regression