Logistic Regression Python Code With Functions