Voting classifier

A very interesting ensemble solution (which can be considered as part of the stacking subset) is offered by the VotingClassifier class, which isn't an actual classifier but a wrapper for a set of different ones that are trained and evaluated in parallel in order to exploit the different peculiarities of each algorithm.

The final decision on a prediction is taken by majority vote according to two different strategies:

  • Hard voting: In this case, the class that received the highest number of votes, Nc(yt), will be chosen:
  • Soft voting: In this case, the probability vectors for each predicted class (for all classifiers) are ...

Get Machine Learning Algorithms - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.