Voting Classifier(Hard Voting and Soft Voting Classifier)

Krish Naik · Intermediate ·📐 ML Fundamentals ·7y ago

Key Takeaways

Builds an EnsembleVoteClassifier using hard voting and soft voting classifier techniques for classification via majority or plurality voting

Full Transcript

hello all today we will be discussing about voting classifier in voting classifier we basically have two different techniques that is called as hard voting classifier and salt voting classifier many of them have not heard this term about voting classifier but this is one of the most sub important topic topic in every machine learning algorithm area most of the machine learning or this kind of voting classifier is basically used in n symbol techniques I hope everybody have heard of in symbol techniques if you have not I have already created many videos on that please go and have a look in n symbol you basically have two types one is bagging and the other one is something called as boosting in fact bagging I have already discussed about random forests in boosting I have already discussed about exhibits my next video will be actually on something called adaboost okay so we'll be discussing about that in my next video but we are focusing more on voting classifier now in order to understand hard voting classifiers or boarding pass now let me just take a very simple example suppose I am discussing about a random forest classifier okay suppose this is my random forest classifier my random forest classifier we have a data set suppose this is my P as you know that we create parallel multiple models like m1 this models will basically be created with the help of decision tree in left inside random forests m3 m4 this four model suppose I have basically have four decision trees inside my random forest classifier okay now what in in random forests what we do is that we take a sample of a data set like this one an other sample of data set with replacement this this step is hole called as bootstrapping okay the bootstrapping you know that random random forest is also called as bootstrap aggregation so what we do we take sample of data we provided to each and every model which is my decision tree this model get trained on this particular sample of data and it will give us some accuracy and finally we calculate the average accuracy of this by finding the mean of all this accuracy when we get the mean of all the security that will be the accuracy of my random forest classifier but whenever we give a new test data and this particular step is basically called as aggregation okay aggregation we call it as aggregation that is what a bootstrap I mean random forest basically means which is all as bootstrap aggregation it is also called as bootstrap now suppose I have a white as data now for the white test data if I want to see how the output is actually predicted now since this is a classifier problem suppose I have two categories of output then my model m1 suppose for white test it is giving it as 0 but model m 2 it says that the output is 1 for a model m3 is saying that the output is 1 and for that model input they saying output is 1 now in hard-working classifier water what it does is that it goes and check it goes and check whether the model is basically giving zeros or ones now here we can see that only model m1 has given me 0 whereas other models like m1 m2 m3 for m2 m3 m4 is basically giving me 1 so it will go and see that where the maximum number of model is giving me the output as 1 or whether it is giving it as 0 now here you can clearly see that maximum number of models or the decision tree is basically giving the output as 1 so the hard-working classifier what it does is that since maximum number of models are giving the output as 1 it will go and predict for this particular white edge data the output will be actually 1 this is very very simple and this is how the voting five words now you know that hard working classifiers getting used in many ensemble techniques it is also getting used in deep learning whenever you also create a custom and symbol technique there also it will be used and that is how a hard-working classify actually wants it's it tries to see that whether maximum number of models are giving it as either one category or the other category if maximum number of models are giving the similar kind of category that is basically selected as the output for that particular whiteness data and that is how hard would you classify works now the question arises how does soft walk voting class and works in soft wording classifier there is only one change instead of giving one output this solve voting classifier will be giving us probabilities probabilities now let me just discuss now suppose M one is basically giving me as 0.9% as one it is saying point nine percent it is one point one percent is this zero now my M two is basically saying that point eight percent it is one this basically means 80 percent it is one and point two twenty percent it is zero now my M three suppose it gives 0.7 percent as one and my M 3 is basically giving point 3 as 0 okay similarly my m4 says that 0.6 percent it is one and point four percent it is zero now what it dub what what this soft wording classifier will do it will find out the average of all these things when it finds out the average this average is nothing but 0.9 plus 0.8 plus 0.7 plus 0.6 divided by 4 so you will be somewhere getting around you know 0.85 approximately again I have not calculated it so 0.85 percent it says that this particular model is basically giving us 1 and if we try to find out that mean of all this right at that time we will be somewhere getting has point 1 5 it will be 1 it will be 0 now here we can directly see that 0.85 is greater than point 1 0.15 so this probability will be selected that basically means this is the output that will be selected for that wise data and that is how a soft voting classifier works very simple and now I hope you understood the basic difference our wooden classifiers of working classifier this particular classifier is basically used in both machine learning and deep learning techniques most of the in-sample techniques are voting classify actually works and if you take an example of deep learning if you if you know Kira's right who are there for every model there is a functionality called as predict under scope prop 8 which is nothing but predict probability and that is where we are basically going to use the software in classifiers okay now this was all about voting classifier guys if you are not subscribed to channel please do subscribe the channel my next video will be on adaboost I don't know if they're going to implement some of the projects as I go out please keep on learning never give up and I'll see you all in the next video have a great day ahead and god bless you all thank you one and all

Original Description

The EnsembleVoteClassifier is a meta-classifier for combining similar or conceptually different machine learning classifiers for classification via majority or plurality voting.In hard voting, we predict the final class label as the class label that has been predicted most frequently by the classification models Data Science Interview Question playlist: https://www.youtube.com/watch?v=820Qr4BH0YM&list=PLZoTAELRMXVPkl7oRvzyNnyj1HS4wt2K- Data Science Projects playlist: https://www.youtube.com/watch?v=5Txi0nHIe0o&list=PLZoTAELRMXVNUcr7osiU7CCm8hcaqSzGw NLP playlist: https://www.youtube.com/watch?v=6ZVf1jnEKGI&list=PLZoTAELRMXVMdJ5sqbCK2LiM0HhQVWNzm Statistics Playlist: https://www.youtube.com/watch?v=GGZfVeZs_v4&list=PLZoTAELRMXVMhVyr3Ri9IQ-t5QPBtxzJO Feature Engineering playlist: https://www.youtube.com/watch?v=NgoLMsaZ4HU&list=PLZoTAELRMXVPwYGE2PXD3x0bfKnR0cJjN Computer Vision playlist: https://www.youtube.com/watch?v=mT34_yu5pbg&list=PLZoTAELRMXVOIBRx0andphYJ7iakSg3Lk You can buy my book on Finance with Machine Learning and Deep Learning from the below url amazon url: https://www.amazon.in/Hands-Python-Finance-implementing-strategies/dp/1789346371/ref=sr_1_1?keywords=krish+naik&qid=1560943725&s=gateway&sr=8-1
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Krish Naik · Krish Naik · 57 of 60

1 Natural Language Processing|Stemming
Natural Language Processing|Stemming
Krish Naik
2 Natural Language Processing|BagofWords
Natural Language Processing|BagofWords
Krish Naik
3 Gaussian distribution or Normal Distribution in statisctics
Gaussian distribution or Normal Distribution in statisctics
Krish Naik
4 Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Krish Naik
5 Log Normal Distribution in Statistics
Log Normal Distribution in Statistics
Krish Naik
6 Covariance in Statistics
Covariance in Statistics
Krish Naik
7 Confusion matrix, Precision, Recall| Data Science Interview questions
Confusion matrix, Precision, Recall| Data Science Interview questions
Krish Naik
8 Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Krish Naik
9 Implementing a Spam classifier in python| Natural Language Processing
Implementing a Spam classifier in python| Natural Language Processing
Krish Naik
10 Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Krish Naik
11 Face Recognition using open CV and VGG 16 Transfer Learning
Face Recognition using open CV and VGG 16 Transfer Learning
Krish Naik
12 Pedestrian Detection using OpenCV from Videos
Pedestrian Detection using OpenCV from Videos
Krish Naik
13 Face and Eye Detection from Videos using HAAR Cascade Classifier
Face and Eye Detection from Videos using HAAR Cascade Classifier
Krish Naik
14 Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Krish Naik
15 OpenCV Installation | OpenCV tutorial
OpenCV Installation | OpenCV tutorial
Krish Naik
16 Face and Eye Detection from Images using HAAR Cascade Classifier
Face and Eye Detection from Images using HAAR Cascade Classifier
Krish Naik
17 Car Detection using HAAR Cascade and Opencv from Videos.
Car Detection using HAAR Cascade and Opencv from Videos.
Krish Naik
18 Using OpenFace for Face recognition in Keras
Using OpenFace for Face recognition in Keras
Krish Naik
19 OpenPose Tutorial with Tensorflow
OpenPose Tutorial with Tensorflow
Krish Naik
20 Multiple Linear Regression using python and sklearn
Multiple Linear Regression using python and sklearn
Krish Naik
21 Dimensional Reduction| Principal Component Analysis
Dimensional Reduction| Principal Component Analysis
Krish Naik
22 Movie Recommender System using Python
Movie Recommender System using Python
Krish Naik
23 TPR,FPR,FNR,TNR, Confusion Matrix
TPR,FPR,FNR,TNR, Confusion Matrix
Krish Naik
24 Precision, Recall and F1-Score
Precision, Recall and F1-Score
Krish Naik
25 Artificial Neural Network for Customer's Exit Prediction from Bank
Artificial Neural Network for Customer's Exit Prediction from Bank
Krish Naik
26 GridSearchCV- Select the best hyperparameter for any Classification Model
GridSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
27 RandomizedSearchCV- Select the best hyperparameter for any Classification Model
RandomizedSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
28 K Nearest Neighbor classification with Intuition and practical solution
K Nearest Neighbor classification with Intuition and practical solution
Krish Naik
29 K Means Clustering Intuition
K Means Clustering Intuition
Krish Naik
30 Create custom Alexa Skill- Lambda function- Part2
Create custom Alexa Skill- Lambda function- Part2
Krish Naik
31 Hierarchical Clustering intuition
Hierarchical Clustering intuition
Krish Naik
32 Implement Transfer Learning with a generic Code Template
Implement Transfer Learning with a generic Code Template
Krish Naik
33 Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Krish Naik
34 Unlock Your Application With Your Face using OpenCV
Unlock Your Application With Your Face using OpenCV
Krish Naik
35 Draw rectangle from webcam and sketch process it on a live feed
Draw rectangle from webcam and sketch process it on a live feed
Krish Naik
36 Complete Life Cycle of a Data Science Project
Complete Life Cycle of a Data Science Project
Krish Naik
37 How we can apply Machine Learning in Finance
How we can apply Machine Learning in Finance
Krish Naik
38 Deep Learning in Medical Science
Deep Learning in Medical Science
Krish Naik
39 How to switch your career to Data Science.
How to switch your career to Data Science.
Krish Naik
40 Linear Regression Mathematical Intuition
Linear Regression Mathematical Intuition
Krish Naik
41 Handle Categorical features using Python
Handle Categorical features using Python
Krish Naik
42 Machine Learning Algorithm- Which one to choose for your Problem?
Machine Learning Algorithm- Which one to choose for your Problem?
Krish Naik
43 DBSCAN Clustering Easily Explained with Implementation
DBSCAN Clustering Easily Explained with Implementation
Krish Naik
44 Curse of Dimensionality Easily explained| Machine Learning
Curse of Dimensionality Easily explained| Machine Learning
Krish Naik
45 Feature Selection Techniques Easily Explained | Machine Learning
Feature Selection Techniques Easily Explained | Machine Learning
Krish Naik
46 Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Krish Naik
47 Cross Validation using sklearn and python | Machine Learning
Cross Validation using sklearn and python | Machine Learning
Krish Naik
48 Handling Missing Data Easily Explained| Machine Learning
Handling Missing Data Easily Explained| Machine Learning
Krish Naik
49 Deploy Machine Learning Model using Flask
Deploy Machine Learning Model using Flask
Krish Naik
50 Deployment of Deep Learning Model using Flask
Deployment of Deep Learning Model using Flask
Krish Naik
51 How to Visualize Multiple Linear Regression in python
How to Visualize Multiple Linear Regression in python
Krish Naik
52 K Nearest Neighbour Easily Explained with Implementation
K Nearest Neighbour Easily Explained with Implementation
Krish Naik
53 Predicting Heart Disease using Machine Learning
Predicting Heart Disease using Machine Learning
Krish Naik
54 Predicting Lungs Disease using Deep Learning
Predicting Lungs Disease using Deep Learning
Krish Naik
55 Stock Sentiment Analysis using News Headlines
Stock Sentiment Analysis using News Headlines
Krish Naik
56 Random Forest(Bootstrap Aggregation) Easily Explained
Random Forest(Bootstrap Aggregation) Easily Explained
Krish Naik
Voting Classifier(Hard Voting and Soft Voting Classifier)
Voting Classifier(Hard Voting and Soft Voting Classifier)
Krish Naik
58 Credit Card Fraud Detection using Machine Learning from Kaggle
Credit Card Fraud Detection using Machine Learning from Kaggle
Krish Naik
59 Hyperparameter Optimization for Xgboost
Hyperparameter Optimization for Xgboost
Krish Naik
60 Tutorial 45-Handling imbalanced Dataset  using python- Part 1
Tutorial 45-Handling imbalanced Dataset using python- Part 1
Krish Naik

Related Reads

Up next
Dropout in Deep Learning
AnuTech-CH
Watch →