how to train a logistic regression model in python