implementation for logistic reg prediction
regularized cost function