For example, we may have certain preferences on whether we would swim or not. This can be recorded in the table as follows:
Swimming suit |
Water temperature |
Swim preference |
None |
Cold |
No |
None |
Warm |
No |
Small |
Cold |
No |
Small |
Warm |
No |
Good |
Cold |
No |
Good |
Warm |
Yes |
Data in this table can be represented alternatively with the following decision tree, for example:
![](https://static.packt-cdn.com/products/9781787284586/graphics/assets/6da7881c-3761-4c56-b94a-92a095991311.png)
Figure 3.1.: Decision tree for the swim preference example
At the root node, we ask the question: does one have a swimming suit? The response to the question separates the available data into three groups, each with two rows. If the attribute swimming suit = none, then two rows have the attribute swim preference as no. Therefore, there is no need to ask a question about the temperature of the water as all the samples...