Say you have a set of determistic business rules in an admin system that you want to check. The rules can be based on numeric, boolean, categorical, etc. values, e.g.:
if product in ['x','y','z']:
if age > 30:
if amount < 100000:
rule = 'A'
elif product == 'a':
rule = 'B'
elif ....
Possible checks can be based on a file with possible values or a check that compares the decision tree as a whole provided you have the analysis in a certain format.
You can program these sort of tests, but before starting something from scratch I'm searching if there are some python packages that can help in this sort of work or an approach for such an issue.
To extract rules from a decision tree, one rule is created for each path from the root to a leaf node. Each splitting criterion along a given path is logically ANDed to form the rule antecedent (“IF” part). The leaf node holds the class prediction, forming the rule consequent (“THEN” part).
A decision tree is a flowchart-like tree structure where an internal node represents feature(or attribute), the branch represents a decision rule, and each leaf node represents the outcome. The topmost node in a decision tree is known as the root node. It learns to partition on the basis of the attribute value.
The Decision Tree algorithm, like Naive Bayes, is based on conditional probabilities. Unlike Naive Bayes, decision trees generate rules. A rule is a conditional statement that can easily be understood by humans and easily used within a database to identify a set of records.
DecisionTree is a pure-Python implementation for constructing a decision tree from multidimensional training data and subsequently using the decision tree to classify future data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With