Greets all,
Ingo is quite right that you can filter association rules on the fly, and that is handy. What I needed to do was to be able to store them and sift them, meaning that I needed to convert the rules to examples. No surprise that this is quite easy, as long as you are OK with regexes. Here is the code, obviously in crude form, as that is my forte..
<operator name="Root" class="Process" expanded="yes">
<description text=" "/>
<parameter key="logverbosity" value="warning"/>
<operator name="Define conclusion to look for" class="SingleMacroDefinition">
<parameter key="macro" value="Look_for"/>
<parameter key="value" value="car_practical"/>
</operator>
<operator name="Generate some data" class="DirectMailingExampleSetGenerator">
</operator>
<operator name="Preprocessing" class="OperatorChain" expanded="yes">
<operator name="Make name the ID" class="ChangeAttributeRole">
<parameter key="name" value="name"/>
<parameter key="target_role" value="id"/>
</operator>
<operator name="Association rules, so make label normal attribute" class="ChangeAttributeRole">
<parameter key="name" value="label"/>
</operator>
<operator name="Put numbers into bins" class="BinDiscretization">
<parameter key="range_name_type" value="short"/>
</operator>
<operator name="Dichotomise the attributes" class="Nominal2Binominal">
</operator>
</operator>
<operator name="Make and file away association rules" class="OperatorChain" expanded="yes">
<operator name="Make frequent item sets" class="FPGrowth">
<parameter key="find_min_number_of_itemsets" value="false"/>
<parameter key="min_support" value="0.1"/>
</operator>
<operator name="Make some if then rules" class="AssociationRuleGenerator">
<parameter key="min_confidence" value="0.7"/>
</operator>
<operator name="File the results as assocs" class="ResultWriter">
<parameter key="result_file" value="assocs"/>
</operator>
</operator>
<operator name="Look for the desired conclusion" class="OperatorChain" expanded="yes">
<operator name="Load the results as 1 attribute examples, line by line" class="SimpleExampleSource">
<parameter key="filename" value="assocs"/>
<parameter key="column_separators" value="\n"/>
</operator>
<operator name="Rename attribute assoc (1) to assoc to make it usable" class="ChangeAttributeNamesReplace">
<parameter key="replace_what" value="\s|\(|\)|1"/>
<parameter key="apply_on_special" value="false"/>
</operator>
<operator name="Make example 1 binnable as it only has RM comments" class="SetData">
<parameter key="attribute_name" value="assocs"/>
<parameter key="example_index" value="1"/>
<parameter key="value" value="x"/>
</operator>
<operator name="Make example two the attributes header" class="SetData">
<parameter key="attribute_name" value="assocs"/>
<parameter key="example_index" value="2"/>
<parameter key="value" value="Premises|Conclusions|Confidence"/>
</operator>
<operator name="Bin example 1" class="ExampleFilter">
<parameter key="condition_class" value="attribute_value_filter"/>
<parameter key="parameter_string" value="assocs=x"/>
<parameter key="invert_filter" value="true"/>
</operator>
<operator name="Mark out Premises, Conclusions, and Confidence columns" class="Replace">
<parameter key="attributes" value=".*"/>
<parameter key="replace_what" value="-->|\("/>
<parameter key="replace_by" value="|"/>
</operator>
<operator name="Clear remaining brackets and verbage" class="Replace">
<parameter key="attributes" value=".*"/>
<parameter key="replace_what" value="confidence|\[|\]|\)|\:|\s"/>
</operator>
<operator name="Write out the 1 attribute example set" class="ExampleSetWriter">
<parameter key="example_set_file" value="assocs"/>
<parameter key="quote_nominal_values" value="false"/>
</operator>
<operator name="Read it back as three attribute example set" class="SimpleExampleSource">
<parameter key="filename" value="assocs"/>
<parameter key="read_attribute_names" value="true"/>
<parameter key="column_separators" value="\|"/>
</operator>
<operator name="Replace equals sign in Conclusion" class="Replace">
<parameter key="attributes" value="Con.*"/>
<parameter key="replace_what" value="="/>
<parameter key="replace_by" value="_"/>
</operator>
<operator name="Remove all conclusions except what is looked for" class="Replace">
<parameter key="attributes" value="Con.*"/>
<parameter key="replace_what" value="\b(?:(?!%{Look_for})\w)+\b"/>
</operator>
<operator name="Remove commas" class="Replace">
<parameter key="attributes" value="Con.*"/>
<parameter key="replace_what" value="\,"/>
</operator>
<operator name="Remove all examples except what is looked for" class="ExampleFilter">
<parameter key="condition_class" value="attribute_value_filter"/>
<parameter key="parameter_string" value="Conclusions=\?"/>
<parameter key="invert_filter" value="true"/>
</operator>
</operator>
</operator>
Have fun!
