Extracting decision tree rules for new predicted records

Hello,

I would really appreciate some help with extracting decision tree rules when I score new records. 

When I built the classification model I used Weka 3.6 Random Tree classifier and Weka Predictor. I am not limited to this classifer, if what I want is achievable only with other classifiers that is more than fine.

Is it possible when I output new scored records to a table with their corresponding predicted nominal class, to have in a column the branch where the new records falls into? For example,

ID | Class | Rules

1   |  YES | "Country - Swiss; Income > 250; Age < 26, etc. "

2   |  NO  | ""Country - UK; Income < 100; Age > 33, etc. "

 

Thanks in advance

Unfortunately, there isn't a way to do this easily directly in KNIME.  There might be a solution using R, but I am not enough of a connoisseur of the R decision tree packages to know if this is possible. 

If you want confidence when there are contradicting rules, you might like the Ruleset Predictornode with a weightedSum rule selection method. It will not give you which rules matched, but at least you can have a confidence value. If you set the weights in a special way, you might find out which rules were matched and recreate a table similar you would like to see (you might also need the GroupBy, the power set generator (probably Subset Matcher?), Joiner nodes too).

I think there is no single node that can do this kind of prediction.

Sorry for the noise, I forget the constraint of weka and decision trees, I do not know a solution for that.

Hi
How you did solve it ?