Chapter 4. From Linear Regression to Logistic Regression