logistic regression with javascript