STEM Sims Logo
PDF Lesson Doc Lesson

Science Simulations, Technology Simulations, Engineering Simulations, Mathematics Simulations

Lesson 3: Tree Trimming

People use decision trees to help them make choices in life and in business. Once created, these trees can become very large and hard to work with even when they contain only a few factors. Is there a method to "trim" decision trees to make them more manageable to comprehend and use?

Doing the science

  1. Start the Data Analytics Simulation by clicking on the "Sim" tab.
  2. Choose Data Set 1.
  3. Note the data appearing in the Data Table at the left-hand corner of the screen.
  4. Click and drag the "Rain" icon onto the board area to the right. You’re interested in modeling the data in the first row of the table data.
  5. Since the choice under "Rain" in the first row is "Yes," drag a "Yes" branch onto the "Rain" icon on the board.
  6. Next, drag a "Land" icon onto the "Yes" branch you just placed. Since the choice under "Land" in the first row is "Yes," drag a "Yes" branch onto the "Land" icon on the board.
  7. Next, drag a "Wind" icon onto the "Yes" branch you just placed. Since the choice under "Wind" in the first row is "Yes," drag a "Yes" branch onto the "Wind" icon on the board.
  8. Complete the same process to make the decision tree for the data in the other three rows on the data table.
  9. Count and record in Table 1 the total number of elements in your decision tree (Unpruned). Each node, branch, and decision leaf counts as one element.
  10. Since you know that you only need two "Yes’s" or two "No’s" to make a decision, you can prune your decision tree. Click on the "Pruner" icon. Prune all elements that are unnecessary in your decision tree. Make sure to add a new decision leaf at the end of any empty branches.
  11. Count and record in Table 1 the new total number of elements in your decision tree (Pruned).

Table 1.

Tree Type

Total # of Elements

Unpruned

Pruned

Do You Understand?

  1. How did pruning your decision tree change the total number of elements in the tree?


  2. In what way is pruning a decision tree helpful to a decision-maker?