Ensemble Logistic Regression

Machine Learning
Introduced by
Breiman, L. (bagging); broader ensemble literature
Year
1996–2000s
Type
Ensemble of logistic regression classifiers
Family
Machine learning

What does it do?

Ensemble Logistic Regression fits several logistic regression classifiers on resampled versions of the training data and averages their predicted probabilities.

Because each member outputs a sigmoid value, the averaged output stays between 0 and 1 and serves as a probability-like score. Its calibration is not guaranteed and should be checked before it is read as a probability. The aggregation is intended to reduce the variance of individual logistic fits.

The intuition behind the method

A single logistic regression can be unstable: when the training set changes somewhat, its coefficients and predicted probabilities can shift noticeably. Training many logistic regressors on bootstrap resamples gives a set of fits that differ from one another in systematic ways. Averaging their probability outputs reduces the influence of any single fit, in the same way that averaging repeated noisy measurements reduces the effect of any one error.

History

Breiman (1996) introduced bagging, a general method for reducing the variance of an unstable predictor by averaging predictors fitted to bootstrap samples, and it applies to any base learner. Polikar (2006) reviews ensemble-based systems, including bagging, and the combination rules used to aggregate their members, such as the algebraic combination of outputs. Applying bagging with logistic regression as the base learner is an instance of this general framework.

When to use it

Use Ensemble Logistic Regression when a logistic model is required, for example for its linear form and probability-like outputs, but the individual fits are unstable because of a small or noisy dataset. It applies to binary classification on tabular data, and the formulas on this page cover only that case. Do not use it to correct for class imbalance, data leakage, or underfitting, since these need their own remedies. If the main goal is predictive accuracy on a nonlinear problem, gradient boosting or random forest are usually the better starting points.

Limitations and considerations

  • Individual ensemble members each have their own coefficient vector, and the ensemble as a whole does not provide a single set of coefficients to report.
  • Each member's score is linear in the features. The ensemble therefore cannot represent interactions or curved boundaries unless these are supplied through feature engineering, and bagging does not change this.
  • Training cost grows with the number of members B, since B logistic regressions must be fitted.
  • The gain over a single logistic regression depends on how unstable that single fit is. Where its estimates are already stable, the extra cost may not be justified.
  • Each member relies on the usual logistic regression assumptions: independent observations, log-odds that are linear in the features, and no perfect separation or severe multicollinearity among the predictors. Violations affect every member, and averaging does not remove them.
  • Bootstrap samples contain repeated observations, so each member's effective sample is smaller than the original data and its in-sample fit looks better than its out-of-sample fit. On small or separable samples, members may also fail to converge. Check convergence warnings and the stability of coefficients across members before relying on the ensemble.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • The averaged output is an arithmetic mean of sigmoid values, so it stays between 0 and 1 and works as a probability-like score. Its calibration should be checked before it is interpreted as a probability.
  • Each member is an ordinary logistic regression, so the individual fits can be inspected and compared with a single model.
  • Averaging over members fitted to different resamples reduces the influence of any single fit on the final probabilities.
  • Simple to implement with standard bagging tools applied to a logistic base estimator.
  • When bootstrap resampling is used, the observations left out of each member's resample can serve as an internal performance check without a separate hold-out set.

Applications

  • Binary prediction on tabular data where a logistic model is required and its probability outputs are used directly, with averaging applied to reduce the instability of the fit.
  • Checking whether a single logistic regression is unstable by comparing its coefficients and predictions with those of an ensemble fitted on resamples.
  • Multiclass problems in a one-vs-rest arrangement, where each member is a binary logistic model. The formulas on this page cover only the binary case.
  • Baseline comparison against gradient boosting or random forest, to assess whether a more complex model is needed.

How it works

How it works

1

Training sets are created by resampling, typically by bootstrap (sampling with replacement), so each base classifier is fitted to a different subset of the original examples. The differences between the resulting members are what the averaging step exploits.

2

A logistic regression model is fitted independently on each resampled training set, yielding its own weight vector and intercept. For any new input, each member gives a sigmoid probability, p_b(x) = sigmoid(w_b x + b_b).

Formula
\hat{p}_b(x) = \sigma(\mathbf{w}_b^\top x + b_b)
3

The predicted probabilities from all B base classifiers are averaged into one ensemble probability. Averaging probabilities keeps each member's confidence in the combined value, which a majority vote over hard labels does not.

Formula
\hat{p}(x) = \frac{1}{B}\sum_{b=1}^{B}\hat{p}_b(x)
4

The predicted class is obtained by thresholding the averaged probability at 0.5, as in the formula. For class-imbalanced problems the threshold is a separate choice and can be tuned, for example by optimising F1 or another application-specific metric.

Formula
\hat{y} = \mathbf{1}[\hat{p}(x) \geq 0.5]

Common pitfalls

  • Using the ensemble to correct for class imbalance without applying oversampling, undersampling, or class weighting. Averaging members that are each biased toward the majority class yields a biased ensemble.
  • Reporting an averaged probability as if it came from one interpretable model. The ensemble has no single coefficient vector, and members' coefficients should not be averaged as if they described one model.
  • Assuming the averaged probabilities are well calibrated without checking them. Reliability diagrams and Brier scores can be used to assess calibration.
  • Relying on training accuracy alone, or on out-of-bag estimates alone, when the dataset is very small. Cross-validation gives a more direct estimate of performance.

Frequently asked questions

How many base logistic regression models should the ensemble contain?

There is no fixed rule. Increase the number of members while monitoring out-of-bag or cross-validated performance, and stop when adding members no longer changes it appreciably.

Does averaging probabilities differ from a majority vote?

Yes. Averaging uses each member's predicted probability, so a member's confidence near the decision boundary contributes to the result. A majority vote uses only each member's hard class label.

Can ensemble logistic regression handle nonlinear decision boundaries?

Not in the sense of learning curvature from the features directly. Each member's score is linear in the inputs, and the averaged sigmoid outputs do not give a simple straight-line boundary either. Nonlinear structure needs feature engineering or a nonlinear model such as random forest or gradient boosting.

How does ensemble logistic regression compare to regularized logistic regression?

Regularization (L1 or L2) reduces variance by shrinking the coefficients of a single model, while bagging reduces variance by averaging several fitted models. In principle the two can be combined by regularizing each base classifier and then aggregating them.

Is the ensemble interpretable?

Each member is an interpretable logistic regression, but the ensemble as a whole has no single coefficient vector. Explaining the ensemble as a whole requires a separate method, and any such explanation should be justified and validated before it is relied on.

Related methods

Sources

  1. Breiman, L. (1996). Bagging predictors. Machine Learning, 24(2), 123–140.

    Open DOI reference
  2. Polikar, R. (2006). Ensemble based systems in decision making. IEEE Circuits and Systems Magazine, 6(3), 21–45.

    Open DOI reference