0% found this document useful (0 votes)
32 views3 pages

Lab 9 - Identification Trees

This document describes a lab assignment to train an identification tree classifier to predict whether a person will wait for a table at a restaurant. The identification tree will take in 10 attribute values as input and output a boolean value of true or false. Students are asked to randomly select 10 examples for a training set and 2 for a validation set from 12 provided examples. Then use the training set to build an identification tree and test it on the validation set, returning the number of correct predictions. Coding of the identification tree algorithm is required rather than using existing machine learning libraries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views3 pages

Lab 9 - Identification Trees

This document describes a lab assignment to train an identification tree classifier to predict whether a person will wait for a table at a restaurant. The identification tree will take in 10 attribute values as input and output a boolean value of true or false. Students are asked to randomly select 10 examples for a training set and 2 for a validation set from 12 provided examples. Then use the training set to build an identification tree and test it on the validation set, returning the number of correct predictions. Coding of the identification tree algorithm is required rather than using existing machine learning libraries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Department of Computing

CS370: Artificial Intelligence

Class: BSCS-9AB

Lab 09: Identification Trees

Date: 24-11-2023

Instructor: Dr. Imran Malik


Lab Engineer: Ms Shakeela Bibi

CS370: Artificial Intelligence Page 1


Lab 09: Identification Trees

Introduction:

An Identification Tree is a representation of a function that maps a vector of attribute values to


a single output value—an “Identification”. An identification tree reaches its decision by
performing a sequence of tests, starting at the root and following the appropriate branch until a
leaf is reached. Each internal node in the tree corresponds to a test of the value of one of the
input attributes, the branches from the node are labeled with the possible values of the
attribute, and the leaf nodes specify what value is to be returned by the function.

Lab Task:
Train an Identification Tree classifier considering the following learning problem: the problem
of deciding whether to wait for a table at a restaurant. For this problem the output, is a
Boolean variable that we will call WillWait; it is true for examples where we do wait for a
table. The input, x , is a vector of ten attribute values, each of which has discrete values:

1. ALTERNATE: whether there is a suitable alternative restaurant nearby.


2. BAR: whether the restaurant has a comfortable bar area to wait in.
3. FRI/SAT: true on Fridays and Saturdays.
4. HUNGRY: whether we are hungry right now.
5. PATRONS: how many people are in the restaurant (values are None, Some, and Full).
6. PRICE: the restaurant’s price range ($, $$, $$$).
7. RAINING: whether it is raining outside.
8. RESERVATION: whether we made a reservation.
9. TYPE: the kind of restaurant (French, Italian, Thai, or burger).
10. WAITESTIMATE: host’s wait estimate: 0-10, 10-30, 30-60, or >60 minutes.

A set of 12 examples, taken from the experience of one individual, is shown in the Figure at the
end. Randomly select 10 examples for the training set and 2 examples for validation set. Then
use the training set to build your identification tree. The best solution in this case would give a
general function that takes a training set as input and returns the best possible identification
tree using the ranking disorder approach discussed in the lecture. Once the tree has been built,
test the performance of your tree on the validation set. The best solution in this case would be
a general function that takes an identification tree and the validation set as input and returns
the number of correct predictions on the validation set.

CS370: Artificial Intelligence Page 2


Note: You need to code your own Id tree algorithm for this task. Do not use any functions from
ML libraries like ScikitLearn.

CS370: Artificial Intelligence Page 3

You might also like