Member-only story
Ensemble Learning in Machine Learning | Getting Started
It is much reliable to use various different models rather than just one. A collection of several models working together on a single set is called an Ensemble. The method is called Ensemble Learning.
Voting
You can train your model using diverse algorithms and then ensemble them to predict the final output. Say, you use a Random Forest Classifier, SVM Classifier, Linear Regression etc.; models are pitted against each other and selected upon best performance by voting using the VotingClassifier
Class from sklearn.ensemble
.
Hard voting is where a model is selected from an ensemble to make the final prediction by a simple majority vote for accuracy.
Soft Voting can only be done when all your classifiers can calculate probabilities for the outcomes. Soft voting arrives at the best result by averaging out the probabilities calculated by individual algorithms.
Code:
The accuracy of the VotingClassifier
is generally higher than the individual classifiers. Make…