- Python Deep Learning
- Ivan Vasilev Daniel Slater Gianmario Spacagna Peter Roelants Valentino Zocca
- 344字
- 2021-07-02 14:31:01
Decision Trees
Another popular supervised algorithm is the decision tree. A decision tree creates a classifier in the form of a tree. This is composed of decision nodes, where tests on specific attributes are performed; and leaf nodes, which indicate the value of the target attribute. To classify a new sample, we start at the root of the tree and navigate down the nodes until we reach a leaf.
A classic application of this algorithm is the Iris flower dataset (http://archive.ics.uci.edu/ml/datasets/Iris), which contains data from 50 samples of three types of Irises (Iris Setosa, Iris Virginica, and Iris Versicolor). Ronald Fisher, who created the dataset, measured four different features of these flowers:
- The length of their sepals
- The width of their sepals
- The length of their petals
- The width of their petals
Based on the different combinations of these features, it's possible to create a decision tree to decide which species each flower belongs to. In the following diagram, we have defined a decision tree that will correctly classify almost all the flowers using only two of these features, the petal length and width:

To classify a new sample, we start at the root note of the tree (petal length). If the sample satisfies the condition, we go left to the leaf, representing the Iris Setosa class. If not, we go right to a new node (petal width). This process continues until we reach a leaf. There are different ways to build decision trees, and we will discuss them later, in the chapter.
In recent years, decision trees have seen two major improvements. The first is Random Forests, which is an ensemble method that combines the predictions of multiple trees. The second is Gradient-Boosting Machines, which creates multiple sequential decision trees, where each tree tries to improve the errors made by the previous tree. Thanks to these improvements, decision trees have become very popular when working with certain types of data. For example, they are one of the most popular algorithms used in Kaggle competitions.
- VMware View Security Essentials
- Arduino by Example
- Effective C#:改善C#代碼的50個有效方法(原書第3版)
- Instant Apache Stanbol
- Python語言程序設計
- Python 3網絡爬蟲實戰
- 深入分布式緩存:從原理到實踐
- Spring+Spring MVC+MyBatis從零開始學
- Scala Functional Programming Patterns
- Tableau Desktop可視化高級應用
- Learning Python Data Visualization
- Instant Automapper
- AI自動化測試:技術原理、平臺搭建與工程實踐
- SQL Server 2014 Development Essentials
- 程序員的英語