Machine learning logistic regression in python with an example singmoid function