News from this site

 Rental advertising space, please contact the webmaster if you need cooperation


+focus
focused

classification  

no classification

tag  

no tag

date  

no datas

How does Hard Voting select a result with an even number of classifiers in a VotingClassifier in scikit-learn?

posted on 2024-11-07 20:01     read(408)     comment(0)     like(17)     collect(1)


I have two classifiers in a Voting Classifier which are both being used to predict whether an instance is class 0 or class 1. The results are aggregated using hard voting (which uses a majority vote), however I am unsure how the VotingClassifier makes the decision with an even number of classifiers.


solution


Its mentioned in the documentation here

In the cases of a tie, the VotingClassifier will select the class based on the ascending sort order. E.g., in the following scenario

classifier 1 -> class 2
classifier 2 -> class 1

the class label 1 will be assigned to the sample.

So as explained here, in case of a tie, the alphabetical order will be used to give out the result.



Category of website: technical article > Q&A

Author:qs

link:http://www.pythonblackhole.com/blog/article/246854/9c1ab8081e766a055728/

source:python black hole net

Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.

17 0
collect article
collected

Comment content: (supports up to 255 characters)