TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Getting Started

Gradient Boosted Decision Trees Explained with a Real-Life Example and Some Python Code

9 min readAug 19, 2021

--

Image by author.
Bias of a simplistic (left) vs a complex model (right). [Image by author]

Boosting 101

Boosting algorithms attribute more weight to the observations it misclassified. (Image by author)

What’s common across all Boosting Algorithms

An ensemble of m weak learners. (Image by author)

Creating a Boosting Ensemble

Each new weak learner added minimizes the ensemble’s loss function. (Image by author)
Loss function for the ensemble. (Image by author)

Gradient Boosted Decision Trees vs Adaboost vs …

🛩🏝 Reducing model Bias with Boosting Algorithms

Creating a synthetic dataset with 250 observations. (Image by author)

Spotting Model Bias

(Image by author)
Code sample to train a Decision Tree. (Image by author)
Result of 0–1 misclassification error for the Decision Tree algorithm. (Image by author)
Code sample to train Gradient Boosted Decision Trees. (Image by author)
Result of 0–1 misclassification error for the Gradient Boosted Decision Trees algorithm. (Image by author)
Code sample to train an Adaboost model. (Image by author)
Result of 0–1 misclassification error for the Adaboost algorithm. (Image by author)

Conclusion

Faster predictions vs slower training

Performance over interpretability

References

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Carolina Bento
Carolina Bento

Written by Carolina Bento

Articles about Data Science and Machine Learning | @carolinabento

Responses (1)