liveBook · Manning

Mode

As explained in Ensemble Methods for Machine Learning

Majority voting is an aggregation method that selects the class prediction receiving the most individual model votes.

Majority voting combines classification predictions by selecting the class predicted most often—the statistical mode. Like a chorus choosing one answer, it smooths some individual-model mistakes. section 2.2.1

Apply the method as a prediction-time aggregation procedure:

  • Train several base estimators, often on bootstrap-generated data replicates to create diverse models. section 2.2
  • Collect each estimator’s class prediction for the same input. section 3.2.1
  • Count the predicted classes and return the most frequent one. section 2.2.1

The method is an equal-weight combination scheme: with m base estimators, each receives weight 1/m. It works with homogeneous ensembles such as bagging and heterogeneous collections of strong learners. section 3.2.1

Combining predictions in Python

A simple implementation gathers individual predictions, applies scipy.stats.mode across estimators, and reshapes the result into the final prediction vector. Accuracy can then be measured with sklearn.metrics.accuracy_score; one demonstrated ensemble has a test error of 6.19%. section 3.2.1

Figure 3.8 Combining by majority voting. Bagging can be viewed as a simple weighting method applied to a homogeneous ensemble. All classifiers have equal weights, and the combination function is the majority vote. We can adopt the majority voting strategy for heterogeneous ensembles as well.
CH03_F08_Kunapuli

Shows majority voting as equal weighting applied to both homogeneous and heterogeneous ensembles. section 3.2.1

How Ensemble Methods for Machine Learning covers it

How deep it goes
Explains the mode intuition, equal-weight formulation, ensemble setting, and implementation, while deferring other aggregation schemes.
Examples
Uses bootstrap replicates, ensemble prediction vectors, scipy.stats.mode, and a test-error calculation as concrete artifacts.
What it assumes
Assumes familiarity with base estimators, classification predictions, ensemble methods, and bootstrap-generated training replicates.
What you can do after
Apply it via scipy.stats.mode and evaluate the resulting classifier with sklearn.metrics.accuracy_score.
How it connects
Connects majority voting to model aggregation, bagging, bootstrap sampling, heterogeneous ensembles, and weighted combination.

Also explained in

Compare how 8 books explain mode →

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.