Understanding Logistic Regression in Pythonic Way