AIML Lect5 Assignment ID3
AIML Lect5 Assignment ID3
Consider Position
attribute as a class for classification. Construct full decision tree by applying ID3 algorithm.
Department Age Salary Position
Personnel 31-40 Medium Range Boss
Personnel 21-30 Low Range Assistant
Personnel 31-40 Low Range Assistant
MIS 21-30 Medium Range Assistant
MIS 31-40 High Range Boss
MIS 21-30 Medium Range Assistant
MIS 41-50 High Range Boss
Administration 31-40 Medium Range Boss
Administration 31-40 Medium Range Assistant
Security 41-50 Medium Range Boss
Security 21-30 Low Range Assistant
Table-1
Since Age is having the maximum gain so this attribute is selected as the first splitting attribute. In age
range 31-40, class is not defined while for others range it is defined. So we have to again find out the
spitting attribute for this age range (31-40). Now the tuples that belong to this range is as follows:
Department Salary Position
Personnel Medium Range Boss
Personnel Low Range Assistant
MIS High Range Boss
Administration Medium Range Boss
Administration Medium Range Assistant
The Gain is maximum for salary attribute, so we take salary as the next splitting attribute. In salary middle
range, class is not defined while for others range it is defined. So we have to again find out the spitting
attribute for this middle range. Since only department is left so the department will be next splitting
attribute. Now the tuples that belong to this salary range is as follows:
Department Position
Personnel Boss
Administration Boss
Administration Assistant
Again in Personnel department all persons are Boss while in the Administration there is tie between the
classes. So, the person can be either Boss or Assistant in Administration department.
Now the decision tree is as follows:
Age ?
21-30 41-50
31-40
Assistant
Boss
Salary ?
High Range
Low Range
Medium range
Assistant Boss
Department ?
Administration
Personnel
Boss
Assistant/Boss
Now we will take a new dataset and we will classify the class of each tuple by applying the decision tree
that we have build above.