- Ensemble Machine Learning Cookbook
- Dipayan Sarkar Vijayalakshmi Natarajan
- 255字
- 2021-07-02 13:21:56
How it works...
VotingClassifier implements two types of voting—hard and soft voting. In hard voting, the final class label is predicted as the class label that has been predicted most frequently by the classification models. In other words, the predictions from all classifiers are aggregated to predict the class that gets the most votes. In simple terms, it takes the mode of the predicted class labels.
In hard voting for the class labels, is the prediction based on the majority voting of each classifier
, where i=1.....n observations, we have the following:

As shown in the previous section, we have three models, one from the decision tree, one from the SVMs, and one from logistic regression. Let's say that the models classify a training observation as class 1, class 0, and class 1 respectively. Then with majority voting, we have the following:

In this case, we would classify the observation as class 1.
In the preceding section, in Step 1, we imported the required libraries to build our models. In Step 2, we created our feature set. We also split our data to create the training and testing samples. In Step 3, we trained three models with the decision tree, SVMs, and logistic regression respectively. In Step 4, we looked at the accuracy score of each of the base learners, while in Step 5, we ensembled the models using VotingClassifier() and looked at the accuracy score of the ensemble model.
- 電氣自動(dòng)化專業(yè)英語(yǔ)(第3版)
- PowerShell 3.0 Advanced Administration Handbook
- Dreamweaver CS3網(wǎng)頁(yè)設(shè)計(jì)與網(wǎng)站建設(shè)詳解
- Java開發(fā)技術(shù)全程指南
- 輕松學(xué)Java
- Creo Parametric 1.0中文版從入門到精通
- 精通特征工程
- 西門子S7-200 SMART PLC實(shí)例指導(dǎo)學(xué)與用
- Machine Learning with Apache Spark Quick Start Guide
- 基于Xilinx ISE的FPAG/CPLD設(shè)計(jì)與應(yīng)用
- Python:Data Analytics and Visualization
- Linux內(nèi)核精析
- 樂(lè)高創(chuàng)意機(jī)器人教程(中級(jí) 上冊(cè) 10~16歲) (青少年iCAN+創(chuàng)新創(chuàng)意實(shí)踐指導(dǎo)叢書)
- 從祖先到算法:加速進(jìn)化的人類文化
- Hands-On Generative Adversarial Networks with Keras