fit_logistic function

Fit for logistic regression