As we discussed in Chapter 3, Machine Learning Foundations, a linear model can be thought of casually as a weighted combination of features (for example, a weighted sum) to predict a target value. The features are determined by the observations; the weights of each feature are determined by the model. Linear regression predicts a continuous variable, while logistic regression can be thought of as an extended form of linear regression in which the predicted target undergoes a logit transformation to be converted to a variable that has a range between zero and one. Such a transformation is useful for performing binary classification tasks such as when there are two possible outcomes.
In scikit-learn, these two algorithms are represented by the sklearn.linear_model.LogisticRegression and sklearn.linear_model.LinearRegression classes. We will demonstrate logistic regression in Chapter 7, Making Predictive Models in Healthcare.