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:
- Drawing the decision tree flowchart;
- 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.