The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Rename Premises and Conclusion of Association Rules"
Hello,
I was wondrering if there was a way to Rename the results of Association Rules. Here is my code
<?xml version="1.0" encoding="UTF-8"?><process version="7.4.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.4.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="7.4.000" expanded="true" height="68" name="Retrieve" width="90" x="45" y="136">
<parameter key="repository_entry" value="../data/testData"/>
</operator>
<operator activated="false" class="read_excel" compatibility="7.4.000" expanded="true" height="68" name="Read Excel" width="90" x="45" y="34">
<parameter key="excel_file" value="C:\Users\Stefi\Desktop\Diplomatiki\results\re.xlsx"/>
<parameter key="imported_cell_range" value="A1:BM705"/>
<list key="annotations"/>
<list key="data_set_meta_data_information"/>
</operator>
<operator activated="true" class="numerical_to_binominal" compatibility="7.4.000" expanded="true" height="82" name="Numerical to Binominal" width="90" x="179" y="136">
<parameter key="include_special_attributes" value="true"/>
</operator>
<operator activated="true" class="fp_growth" compatibility="7.4.000" expanded="true" height="82" name="FP-Growth" width="90" x="313" y="136">
<parameter key="find_min_number_of_itemsets" value="false"/>
<parameter key="min_support" value="0.001"/>
</operator>
<operator activated="true" class="create_association_rules" compatibility="7.4.000" expanded="true" height="82" name="Create Association Rules" width="90" x="447" y="136"/>
<operator activated="true" class="store" compatibility="7.4.000" expanded="true" height="68" name="Store" width="90" x="581" y="136">
<parameter key="repository_entry" value="../data/AssociationRules"/>
</operator>
<connect from_op="Retrieve" from_port="output" to_op="Numerical to Binominal" to_port="example set input"/>
<connect from_op="Numerical to Binominal" from_port="example set output" to_op="FP-Growth" to_port="example set"/>
<connect from_op="FP-Growth" from_port="frequent sets" to_op="Create Association Rules" to_port="item sets"/>
<connect from_op="Create Association Rules" from_port="rules" to_op="Store" to_port="input"/>
<connect from_op="Store" from_port="through" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
And these are my results among others
My question is that i want to translate these IDs (eg '321-1106') to 'Data Bases' (for example).
Is there any way to do this?
Thanks in advance,
stfn
Tagged:
0
Best Answer
-
Telcontar120 RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
Yes, but you need to download the Converter extension from the Marketplace to do it (it's free). In that extension there is an operator to change the association rules to an ordinary exampleset. Then you can rename the attributes using Rename (or one of the other variants) and do whatever other data ETL you might want.
1
Answers
You have to frist use the Convertors extension where you can export the Association Rules as an example set. Then you could use the Rename operator. That allows you to rename the attribute column names.
thank you very much for your reply
Thank you! That worked well for me!
Can i ask you something else. When i use "RENAME", if there is no such attribute name (eg. 32110200) i have an error. Can i skip this? I mean if there is not the specific attribute name to skip this and continue to the next one. until it finds those which exist and replace?
Hi,
there are at least two ways to solve this.
1. Put the Rename operator into an Exception handler. If the attribute is there, the Rename will be executed. If not, you just return the original example set (connect the ports in the right part of the nested operator).
2. You can also select the renamed attribute with a regular expression instead of "single". If it matches, fine; if not, nothing will happen.
Regards,
Balázs
(Solution 2 would work with the Rename by Replacing operator.)
Thank you for your reply.
Could you please give me an example for using Handle Exception?
i have tried this but still if for example id "321-2201" is not in the results i have error.
Here is my code
Hi,
you didn't connect the input to the output of the Catch case. If an error happens, no output will be generated - not even the original one.
Regards,
Balázs
Thank you for the reply.
I made a change and i am trying to make everything in one process.
here is my new code
The thing is that i still have no "renames".
Any ideas?
Thanks