
Member-only story
Machine Learning, Editorial, Programming
Decision Trees in Machine Learning (ML) with Python Tutorial
Diving into decision trees in machine learning (ML) with Python
Last updated, January 8, 2021
Author(s): Saniya Parveez, Roberto Iriondo
This tutorial’s code is available on Github and its full implementation as well on Google Colab.
Table of Contents
- What is a Decision Tree?
- Decision Tree Example
- Building a Decision Tree
- Node Impurity
- Entropy
- Gini
- Overfitting in Decision Tree Learning
- Pruning
- Advantages and Disadvantages of Decision-tree-based Classification
- Code Implementation
- Advanced Decision Trees
- Conclusion
- Resources
- References
📚 Check out our gradient descent tutorial. 📚
What is a Decision Tree?
A decision tree is a vital and popular tool for classification and prediction problems in machine learning, statistics, data mining, and machine learning [4]. It describes rules that can be interpreted by humans and applied in a knowledge system such as databases. Fundamentally, a decision tree T encodes d (a classifier or regression function) in the form of a tree structure which presents the following attributes:
- Decision node: It defines a test on a single attribute.
- Leaf node: It shows the value of the target attribute.
- Edge: It is a split of one attribute.
- Path: It is a disjunction of the test to make the final decision.