0
$\begingroup$

I want to develop a script for a decision tree, which I already know its structure, like a flowchart in which each internal node represents a "test" on an attribute (e.g. whether a coin flip comes up heads or tails), each branch represents the outcome of the test, and each leaf node represents a class label. The paths from the root to leaf represent classification rules. Something like this simple decision flow diagram: https://miro.medium.com/max/1258/1*xLKdaL_RFhqFuy1iKSXvXA.png

Is there any library that can help me to avoid developing the whole thing (preferably python or Java)? Ideally, there should be a way to retrieve questions from the DB and when an answer is provided will give the next question until we reach a leaf node with a decision from a database like let's say SQL database entries that somehow the decision tree has been encoded there.

I think implementing the idea would not be difficult. I am just sure that this is popular in certain fields like operation research and definitely there are good libraries out there doing just that.

Searching for such libraries turned out to be difficult due to the similarity with the commonly used decision tree models in ML. Keyword suggestions as to what to search for would be helpful too.

I intend to draw the whole decision tree in Microsoft Visio and export the flowchart into a table that describes the connections, and make a script to translate the diagram into database entries that are compatible with the decision tree library. But I am open to any other suggestion in case there is something better to do that.

TL;DR: Looking for a library or an app to:

  1. Drawing the decision tree flowchart;
  2. exporting the rules from the flowchart to a database or a file to create a questionnaire app that starts from the root question of the decision tree until reaching a decision based on the answers of the user.
$\endgroup$
2
  • $\begingroup$ Are you talking about using data to determine what the tree should look like (a classification tree), or starting with a tree and just coding something that gets the information needed (alone or with friends, rainy or sunny) and works through the existing tree to reach a conclusion? $\endgroup$
    – prubin
    Aug 3 at 15:46
  • $\begingroup$ Thanks, @prubin. I edited the question to make the steps clear. Basically, looking for a library or an app to: 1. Drawing the flowchart; 2. exporting the rules from the flowchart to a database or a file to create a questionnaire app that starts from the root question of the decision tree until reaching a decision based on the answers of the user. $\endgroup$
    – Haider
    Aug 3 at 17:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.