The Department of Computer Science & Engineering
cse@buffalo
STUART C. SHAPIRO: CSE 116 B

CSE 116
Introduction To Computer Science for Majors 2
Lecture B
Lecture Notes
Stuart C. Shapiro
Spring, 2003


Decision Trees

Readings
Riley Chapter 9 ("classification trees")

Introduction
A decision tree is a tree with the following properties:

Decision trees are often used for learning classifications or categories.

The tests are often binary, yes/no or true/false, tests, but needn't be.

Example: A program to play the "Animal game", a version of twenty questions.

The program tries to guess the animal the user is thinking of. Each branch node is a yes/no question about the animal. Each leaf node is an animal.
If the program doesn't guess the animal, it solicits a question and further information from the user to use to grow the tree.
When the user quits playing, the program saves the expanded tree for the next user.

See file://localhost/projects/CSE116/ShapiroCode/Animals/AnimalTree.java
which you may run by executing:

cd /projects/CSE116/ShapiroCode/Animals/
animals &

First Previous Next

Copyright © 2003 by Stuart C. Shapiro. All rights reserved.

Stuart C. Shapiro <shapiro@cse.buffalo.edu>