4

How to convert or visualize decision table to decision tree graph, is there an algorithm to solve it, or a software to visualize it?

For example, I want to visualize my decision table below: https://i.stack.imgur.com/Qe2Pw.jpg

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
Putra Ardiansyah
  • 5,249
  • 4
  • 25
  • 37

3 Answers3

3

Gotta say that is an interesting question.

I don't know the definitive answer, but I'd propose such a method:

  • use Karnaugh map to turn your decision table to minimized boolean function
  • turn your function into a tree

Lets simplyify an example, and assume that using Karnaugh got you function (a and b) or c or d. You can turn that into a tree as:

enter image description here

Source: my own

Filip Malczak
  • 3,124
  • 24
  • 44
1

It certainly is easier to generate a decision table from a decision tree, not the other way around.

But the way I see it you could convert your decision table to a data set. Let the 'Disease' be the class attribute and treat the evidence as simple binary instance attributes. From that you can easily generate a decision tree using one of available decision tree induction algorithms, for example C4.5. Just remember to disable pruning and lower the minimum number of objects parameter.

During that process you would lose a bit of information, but the accuracy would remain the same. Take a look at both rows describing disease D04 - the second row is in fact more general than the first. Decision tree generated from this data would recognize the mentioned disease only from E11, 12 and 13 attributes, since it's enough to correctly label the instance.

JacekMiszczak
  • 31
  • 1
  • 5
  • Yes, actually that is my problem when using DT Algorithms, they shall remove the attributes with low information gain while I need to create tree with no attribute elimination. – Putra Ardiansyah Jul 31 '15 at 18:00
  • One thing that comes to mind is changing those labels that have multiple rows in your table. For example change D01 to D01_1 and D01_2 and after induction, in the created DT, simply change it back to D01. – JacekMiszczak Jul 31 '15 at 21:18
  • I have tried changing disease/class label just like you said, but DT still remove Evidence E01 for Disease D01. I used Random Forest Algorithm to generate the DT. – Putra Ardiansyah Aug 02 '15 at 19:08
  • Evidence E01 gives absolutely no information required for recognizing those diseases, so I'm afraid regular DT induction algorithms will disregard it. Also, you chose possibly the worst algorithm for this case - Random Forest generates not one decision tree, but an ensemble containing many different DTs. It also uses random attribute selection in order to diversify the trees in the forest, that could cause you to lose the E01 attribute. Try using ID3 or C4.5, but remember to disable pre- and post- pruning. – JacekMiszczak Aug 04 '15 at 09:20
1

I've spent few hours looking for a good algorithm. But I'm happy with my results. My code is too dirty now to paste here (I can share privately on request, on your discretion) but the general idea is as the following.

Assume you have a data set with some decision criteria and outcome.

  1. Define a tree structure (e.g. data.tree in R) and create "Start" root node.
  2. Calculate outcome entropy of your data set. If entropy is zero you are done.
  3. Using each criterion, one by one, as tree node calculate entropy for all branches created with this criterion. Take the minimum one entropy of all branches.
  4. Branches created with the criterion with the smallest (minimum) entropy are your next tree node. Add them as child nodes.
  5. Split your data according to decision point/tree node found in step 4 and remove the criterion used.
  6. Repeat step 2-4 for each branch until your all branches have entropy = 0.
  7. Enjoy your ideal decision tree :)