Member-only story

Ensemble Learning in Machine Learning | Getting Started

Sagar Howal
Towards Data Science
5 min readDec 6, 2017

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…

--

--

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

Sagar Howal
Sagar Howal

Written by Sagar Howal

I pretend to understand Artificial Intelligence for a living. Data Science MSc. Electrical Engineer. Musician. Nerd.

Responses (5)