A python logistic regression implemenation