firing multiple rules

I have some rules of the form

if col1 > 10 AND col1< 32 => 0

if col17 > 12 AND col17< 132 => 0

if col1 > 12 AND col1< 52 => 3

if col17 > 21 AND col17< 192 =>  3

For col1= 18 and col17=133 several rules may fire. Not interested in only firing 1st one that matches.

There are many such rules. I need to fire all rules and then to ascertain how many times the consequent occurs. This will be the most probably value for my input dataset. It's  form of prediction/classification.

Any ideas? Rule-variable? Do discuss





You can put your rules to a table, iterate through them with a tablerow to variable loop and in the loop you can set the rule based on the flow variable (you have to have at least a comment rule to have an array in the flow variables tab). Based on those, you will have the outputs as missing or the values after the loop. The non-missings should be replaced with 1, the missings with 0 and after that a group by a (set of) key columns will give you how many rules fired for each row. Would this help to solve your problem?

Cheers, gabor

PS.: Or just create a new node based on the Rule Engine (it is now in jsnippets). It was created with a similar use case also in mind, so it would be easy to implement this change.

Thanks aborg. the tablerow to variable idea worked just fine. thanks a lot.  WF attached for other souls. Would be nice to have a node though.