Majority Voting

Machine Learning
Introduced by
Leo Breiman
Year
1996
Type
voting aggregation
Family
Ensemble

What does it do?

Majority voting is an ensemble rule for classification that combines the predictions of several base classifiers.

Each classifier casts one vote for a single class label, and the label with the most votes is returned; this variant is also called hard voting. It is one of the simplest ways to combine classifier outputs and is covered in the literature on combining pattern classifiers, for example in the Kuncheva (2004) book listed among the references.

The intuition behind the method

The idea is that several imperfect classifiers can produce a more reliable collective decision than any one of them. If the models make different errors on a given sample, the errors tend to be outvoted by the correct label. The benefit depends on disagreement: when the models mostly agree, the vote adds little, and when they share the same mistakes, the vote reproduces those mistakes. The rule works best when each base classifier is better than chance on its own and their errors differ from one another. Because the rule counts votes rather than measuring confidence, every classifier has the same influence regardless of how accurate it is.

History

Majority voting is a long-established combination rule for classifier outputs. Breiman (1996), cited on this page, is the reference for bagging, which trains classifiers on bootstrap samples and combines them; it is cited here for that technique rather than as the origin of the voting rule. Kuncheva (2004), a book on methods for combining pattern classifiers, is listed among the references for a broader treatment of combination methods.

When to use it

Use majority voting for classification when several trained classifiers are already available and you want an equal-weight combination without training an additional combining model. It applies to binary and multi-class problems, and to heterogeneous ensembles, because each classifier only needs to output a label. Do not use it for regression, where averaging the predictions is the appropriate combination. It is also a poor choice when the classifiers are highly similar, since their votes will be nearly redundant, or when some classifiers are clearly more accurate than others and should carry more weight; in that case, stacked generalization (listed among the related methods), which learns how to combine the base outputs, is a better candidate. If you need calibrated class probabilities rather than labels, averaging probabilities (soft voting) is usually more informative.

Limitations and considerations

  • Every classifier has the same vote, so a weak model counts as much as a strong one; the rule does not learn that some models are more reliable.
  • If the base classifiers make the same errors on the same samples, the majority reproduces those errors and the ensemble gains nothing.
  • With more than two classes, ties can occur even when K is odd (for example, three classes receiving one vote each from three classifiers), so a tiebreak rule is needed in general.
  • The benefit depends on the diversity and individual quality of the base classifiers; a diverse set of poor classifiers can still perform badly.
  • Prediction cost grows with the number of base classifiers, since each one must be evaluated for every sample before the votes are counted.

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

Strengths

  • The combination rule has no parameters to fit: given the K predicted labels, the output is fully determined by counting.
  • Because each classifier contributes only a predicted label, models of different types can be combined in one ensemble.
  • The result can be explained directly in terms of which classifiers voted for which class.

Applications

  • Medical diagnosis: combining predictions from multiple clinical decision support models, which can reduce the variance arising from individual model errors; voting does not remove bias that all of the models share.
  • Spam detection: aggregating decisions from rule-based filters, Naive Bayes, and SVM classifiers.
  • Credit risk assessment: ensemble of decision trees and logistic regression models voting on loan approval.
  • Image classification: multiple convolutional neural networks voting on object category in computer vision.
  • Sentiment analysis: combining output of LSTM, transformer, and hand-crafted feature models on text reviews.

How it works

How it works

1

Train K base classifiers of any type (for example decision trees, logistic regression or neural networks) on the same training data or on different bootstrap samples of it. Bootstrap sampling, as in the bagging approach of Breiman (1996), is one way to make the classifiers differ from each other, which matters because identical models always vote identically.

2

For a new sample, each of the K trained classifiers returns one predicted class label. Only these labels are used; hard voting ignores any probability or confidence scores the models may produce.

3

Count, for each class c, the number of classifiers that predicted c, and assign the sample to the class with the largest count (the plurality rule). If two or more classes share the largest count, apply a tiebreak rule fixed before training, such as random selection or a predefined class priority.

Common pitfalls

  • Training every base classifier on exactly the same data with the same algorithm produces highly correlated votes, so the ensemble adds little over a single model.
  • Adding classifiers that are below chance or strongly biased gives them full voting power, which can pull the majority toward the wrong class.
  • Assuming the vote will improve accuracy without checking, on held-out data, that the base classifiers make sufficiently different errors.
  • Leaving ties to an unspecified rule; unseeded random tiebreaking makes repeated predictions on the same sample differ, so the tiebreak rule should be fixed in advance, for example with a fixed random seed or a predefined class priority.

Frequently asked questions

How do I choose the number of base classifiers?

There is no universal number; choose it by validation performance. Additional classifiers can stabilise the vote, but the gain shrinks once the classifiers are largely redundant, and each extra model adds training and prediction cost. Diversity matters more than count.

What if a tie occurs?

Define a tiebreak rule before training and apply it consistently: for example, a random choice with a fixed seed, or a predefined priority order over the classes. Note that hard voting uses labels only; if you want to break ties using confidence scores, that is a different (soft) rule and should be reported as such.

Can I use majority voting with regression problems?

Hard voting is designed for classification. For regression, use the mean or a weighted average of the predicted values instead.

Does base classifier diversity guarantee better ensemble performance?

No. Diversity helps only if the base classifiers are also better than chance on their own. Assess diversity and accuracy on held-out data rather than on the training data, because training errors are optimistic and can understate how much the classifiers differ.

Related methods

Sources

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

    Open DOI reference
  2. Kuncheva, L. I. (2004). Combining Pattern Classifiers: Methods and Algorithms. Wiley-Interscience.

    Open publication reference