7

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.

Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
luck
  • 89
  • 3
  • 1
    Are you looking for a library that is able to _build_ such a tree? Or just evaluate it? – georg Jun 15 '12 at 08:28
  • I'm want to implement some testingcode that can test several decision trees. So I'll have to define the tree based on a document from an analyst and try to check this with the implementation in an admin system. What I'm not looking for is to build a tree on some sort of training data. That's what I meant with a "deterministic" tree – luck Jun 15 '12 at 11:48

1 Answers1

2

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.

shihongzhi
  • 1,921
  • 16
  • 17
  • I also encountered this but it seemed to me that it only works for categorical fields. A lot of the conditions in the tree are boolean conditions on numeric data. Nevertheless I'll try it out. – luck Jun 15 '12 at 11:49