Decision Tree Example: Locating a New Bar
Example taken from Callan, R. (2003). Artificial Intelligence, Basingstoke, UK:
Palgrave MacMillan, p. 242-247.
A brewery owns a chain of bars/restaurants and wants to construct a way in which
they can assess the suitability of a new site for a bar, based upon certain attributes.
The attributes for a set of example data are given in the following table:
City/Town
University
Housing Estate
Industrial Estate
Transport
Schools
Class
1
0
11
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
The attributes define whether the example is a:
1. City or town: Yes or No.
2. Has a University nearby: Yes or No.
Matthew Casey
Page 1 of 3
3. What type of housing estate, if any, is nearby: None, Small, Medium or Large.
4. Has an industrial estate nearby: Yes or No.
5. What is the quality of public transport like: Good, Average or Poor.
6. The number of schools nearby: Small, Medium or Large.
The class defines whether the brewery considers the site good (+) or bad (-).
Matthew Casey
Page 2 of 3
Exercise
In a group, complete the following tasks:
1. Using the examples, construct a decision tree that the brewery can use to assess a
new site.
Hint: look at each attribute in turn to determine if a single, or a group of
attributes and values always give either a positive (+) or negative (-) class.
2. Test your decision tree using the following examples, noting the outcome:
City/Town
University
Housing Estate
Industrial Estate
Transport
Schools
21
22
23
24
25
26
27
28
29
When thinking about these tasks, consider the following:
1. How did you construct the tree using the examples?
2. How did you choose which attribute you should use first and subsequently? Why?
3. Are there any attributes that you did not use?
4. How many trees can you construct using the same example data? If there is more
than one tree, which is the best, and why?
Matthew Casey
Page 3 of 3