The Department of Computer Science & Engineering |
STUART C. SHAPIRO: CSE
116 B
|
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.
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 &