liveBook · Manning

Logistic regression

As explained in Ensemble Methods for Machine Learning

Logistic regression is a statistical classification model that estimates class probabilities by applying a logistic function to a linear combination of input features.

Logistic regression classifies two outcomes, such as 0 or 1, by passing a linear combination of features through the sigmoid function. The result is a probability between 0 and 1. Its linear predictor represents log-odds: ln(p/(1−p)) = β0 + β′x. The Bernoulli distribution models the yes/no target, making the method suitable for binary classification. section 7.1.3

Read a fitted model through its additive feature weights:

  • A positive weight increases the predicted log-odds and therefore increases the odds of the positive class. section 9.1.3
  • Increasing a feature by one unit multiplies the odds by the exponential of its weight; a weight of 0.5 multiplies them by about 1.65. section 9.1.3

From diagnosis to implementation

For diabetes diagnosis, age and blood-glucose measurements can form an additive predictor of positive-diagnosis log-odds. A practical breast-cancer workflow standardizes the data, splits it into training and test sets, fits scikit-learn's LogisticRegression with L1 penalty and the saga solver, predicts test labels, and examines feature weights. section 9.1.3

Figure 7.5 Logistic regression (left) fits 0/1-valued targets by assuming that the spread of the targets can be modeled by the discrete-valued Bernoulli distribution (right). Observe how the prediction probabilities (the heights of the bars) of Class 0 and Class 1 change with the data.
CH07_F05_Kunapuli

Use the figure to see how class-0 and class-1 prediction probabilities change across a one-feature dataset under a Bernoulli model. section 7.1.3

How Ensemble Methods for Machine Learning covers it

How deep it goes
Explains the logit, sigmoid, Bernoulli assumption, additive weights, and odds interpretation, then demonstrates library training.
Examples
Uses diabetes diagnosis, breast-cancer diagnosis, a one-feature probability figure, and a scikit-learn training listing.
What it assumes
Assumes familiarity with features, labels, regression, probability, and exponential notation while reinforcing binary-label modeling.
What you can do after
Apply it via scikit-learn, estimate binary-class probabilities, and interpret feature effects through changes in odds.
How it connects
Connects generalized linear models, linear regression, Poisson regression, sigmoid functions, log-odds, odds, and Bernoulli distributions.

Also explained in

Compare how 12 books explain logistic regression →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.