0% found this document useful (0 votes)
4 views5 pages

Bagging vs Boosting in Machine Learning

Bagging and Boosting are two ensemble learning techniques that enhance machine learning performance by combining multiple models. Bagging reduces variance by training models independently and in parallel, while Boosting focuses on reducing bias by training models sequentially and adaptively, correcting errors from previous models. Both methods generate multiple learners from a single learner and improve stability, but they differ in their approach and application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Bagging vs Boosting in Machine Learning

Bagging and Boosting are two ensemble learning techniques that enhance machine learning performance by combining multiple models. Bagging reduces variance by training models independently and in parallel, while Boosting focuses on reducing bias by training models sequentially and adaptively, correcting errors from previous models. Both methods generate multiple learners from a single learner and improve stability, but they differ in their approach and application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Bagging vs Boosting in Machine Learning

Last Updated : 23 Jul, 2024

As we know, Ensemble learning helps improve machine learning results by combining several
models. This approach allows the production of better predictive performance compared to a
single model. Basic idea is to learn a set of classifiers (experts) and to allow them to
vote. Bagging and Boosting are two types of Ensemble Learning. These two decrease the
variance of a single estimate as they combine several estimates from different models. So the
result may be a model with higher stability. Let’s understand these two terms in a glimpse.

1. Bagging: It is a homogeneous weak learners’ model that learns from each other
independently in parallel and combines them for determining the model average.
2. Boosting: It is also a homogeneous weak learners’ model but works differently from
Bagging. In this model, learners learn sequentially and adaptively to improve model
predictions of a learning algorithm.

Let’s look at both of them in detail and understand the Difference between Bagging and
Boosting.

Bagging
Bootstrap Aggregating, also known as bagging, is a machine learning ensemble meta-algorithm
designed to improve the stability and accuracy of machine learning algorithms used in statistical
classification and regression. It decreases the variance and helps to avoid overfitting. It is
usually applied to decision tree methods. Bagging is a special case of the model averaging
approach.

Description of the Technique

Suppose a set D of d tuples, at each iteration i, a training set Di of d tuples is selected via row
sampling with a replacement method (i.e., there can be repetitive elements from different d
tuples) from D (i.e., bootstrap). Then a classifier model Mi is learned for each training set D < i.
Each classifier Mi returns its class prediction. The bagged classifier M* counts the votes and
assigns the class with the most votes to X (unknown sample).

Implementation Steps of Bagging

Step 1: Multiple subsets are created from the original data set with equal tuples, selecting
observations with replacement.
Step 2: A base model is created on each of these subsets.
Step 3: Each model is learned in parallel with each training set and independent of each
other.
Step 4: The final predictions are determined by combining the predictions from all the
models.

An illustration for the concept of b ootstrap aggregating (Bagging)

Example of Bagging

The Random Forest model uses Bagging, where decision tree models with higher variance are
present. It makes random feature selection to grow trees. Several random trees make a Random
Forest.

To read more refer to this article: Bagging classifier

Boosting
Boosting is an ensemble modeling technique designed to create a strong classifier by
combining multiple weak classifiers. The process involves building models sequentially, where
each new model aims to correct the errors made by the previous ones.

Initially, a model is built using the training data.


Subsequent models are then trained to address the mistakes of their predecessors.
boosting assigns weights to the data points in the original dataset.
Higher weights: Instances that were misclassified by the previous model receive higher
weights.
Lower weights: Instances that were correctly classified receive lower weights.
Training on weighted data: The subsequent model learns from the weighted dataset,
focusing its attention on harder-to-learn examples (those with higher weights).
This iterative process continues until:
The entire training dataset is accurately predicted, or
A predefined maximum number of models is reached.

Boosting Algorithms
There are several boosting algorithms. The original ones, proposed by Robert
Schapire and Yoav Freund were not adaptive and could not take full advantage of the weak
learners. Schapire and Freund then developed AdaBoost, an adaptive boosting algorithm that
won the prestigious Gödel Prize. AdaBoost was the first really successful boosting algorithm
developed for the purpose of binary classification. AdaBoost is short for Adaptive Boosting and
is a very popular boosting technique that combines multiple “weak classifiers” into a single
“strong classifier”.

Algorithm:

1. Initialise the dataset and assign equal weight to each of the data point.

2. Provide this as input to the model and identify the wrongly classified data points.

3. Increase the weight of the wrongly classified data points and decrease the weights of
correctly classified data points. And then normalize the weights of all data points.

4. if (got required results)


Goto step 5
else
Goto step 2

5. End

An illustration presenting the intuition b ehind the b oosting algorithm, consisting of the parallel learners and weighted dataset.
To read more refer to this article: Boosting and AdaBoost in ML

Similarities Between Bagging and Boosting

Bagging and Boosting, both being the commonly used methods, have a universal similarity of
being classified as ensemble methods. Here we will explain the similarities between them.

1. Both are ensemble methods to get N learners from 1 learner.


2. Both generate several training data sets by random sampling.
3. Both make the final decision by averaging the N learners (or taking the majority of them i.e
Majority Voting).
4. Both are good at reducing variance and provide higher stability.

Differences Between Bagging and Boosting


S.NO Bagging Boosting

1. The simplest way of combining A way of combining predictions


predictions that that
belong to the same type. belong to the different types.

2. Aim to decrease variance, not Aim to decrease bias, not variance.


bias.

3. Each model receives equal Models are weighted according to


weight. their performance.

4. Each model is built New models are influenced


independently. by the performance of previously
built models.

5. Different training data subsets Iteratively train models, with each


are selected using row sampling new model focusing on correcting
with replacement and random the errors (misclassifications or
sampling methods from the high residuals) of the previous
entire training dataset. models

6. Bagging tries to solve the over- Boosting tries to reduce bias.


fitting problem.

7. If the classifier is unstable (high If the classifier is stable and simple


variance), then apply bagging. (high bias) the apply boosting.

8. In this base classifiers are In this base classifiers are trained


trained parallelly. sequentially.

9 Example: The Random forest Example: The AdaBoost uses


model uses Bagging. Boosting techniques

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy