Logistic Regression Algorithm in Java