logRegression training function works