Why do we need a decision tree?

This short article will discover decision trees mostly from the business side in software development, but there are also decision trees as part of the code. 

What is a decision tree, why do you need it and what do you need to construct it? Let’s start at the end. 

First of all for a decision tree you need previous experience, it could be the exact cases of developing a product in this particular application development environment, coding in exact language and so on. So you should collect your data and decide which sample of it is most relevant for your current situation. 

So why do you need a decision tree? To make the best choice among disparate options. Decision trees help you to build a way and predict possibilities of certain actions. You visualize your actions and put yourself into different conditions, where your decisions could be made and you can see the results of your deals and stop at some point or continue to grow possibilities. 

We finally got to the answer. Decision tree is a simplified schematic algorithm that represents your actions depending on the conditions in which they are implemented. 

 Pros and cons of decision trees

 Let’s start from advantages of decision trees:

You can make forecasts based on your previous experience, so the algorithm is specifically personal.

Easily count the cost of your decision and choose between profits and find which fits you the most.

Quantitative analyses and data injection into the decision making process.

You can make arrangements of your tree and add new scenarios. It’s easy to do compared with decision tables, which we will observe later.

And disadvantages:

Not always efficient estimates, because of progress and new addings to your decision tree. The structure is pretty unstable for dynamic variables. 

Using decision trees in an absolutely new sphere is quite risky, because of uncertainty of a new market or type of product

Difficult calculations, but it is only for those trees you are creating by hand.

Summarizing, of course individual for everyone, depending on your project, its complexity, size, etc.

Decision tables

We will be precise and short about decision tables. Decision table is a tabular depiction of conditions and actions. 

Let’s study the example. We have two conditions to enter the app: login and password. Both of them could be accepted or rejected. So we have four possible situations:

  1. wrong login and wrong password – reject
  2. wrong login and right password – reject
  3. right login and wrong password – reject
  4. right login and right password – accept

Number of actions and conditions could be different and in this case you`ll have more combinations and ways to solve the problem.

To convert this table to the tree we need to note some graphic denotement for it.

Square node – decision node: condition to set the data

Round node – chance/outcome/event node: class of a new data point

Triangle node – terminal node: the endpoint

In our example, the first three actions will end with a terminal node, but the last one could be an event node, because we can continue our interaction with the application after we pass this step.

Here we want to share with you some tools for creating decision trees with the help of apps and websites to facilitate your work:

To talk about development, decision trees are used in lots of fields, such as medicine, engineering, data mining and AI. Decision tree software is really important for artificial intelligence, because it helps AI patterns to choose the best way to do some actions or in reverse avoid them. 

Article based on materials:

Decision Trees & Decision Tables

A level Business Revision – Usefulness of Decision Trees

Difference between decision table and decision tree

A complete guide to decision tree software

Author Yaroslava Volynska

Illustrations by Kateryna Prynada