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
How to generate a macro for output values?
Hi,
I would like to generate a general macro which extracts the output (attribute values) independent of the model. Because dependent on the selected model,each output has a different attribute name. Therefore it makes no sense to generate a macro with the "attribute name" of the output.
However, I have no idea how to create such a macro. Can anybody help? Or is there already an Operator with such a function?
Thank you!
0
Best Answers
-
MartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data ScientistHi @LeMarc ,das ist interssanterweise etwas, was nicht mit operatoren geht. Ich habe mich auch schon ein paar mal gefragt warum. Anbei ist Prozess, der Execute Script nutzt um das zu lösen. Das ist mein Workaround für das Problem. Ich hoffe, dass das hilft.
LG,Martin<?xml version="1.0" encoding="UTF-8"?><process version="9.6.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="9.6.000" expanded="true" name="Process">
<parameter key="logverbosity" value="init"/>
<parameter key="random_seed" value="2001"/>
<parameter key="send_mail" value="never"/>
<parameter key="notification_email" value=""/>
<parameter key="process_duration_for_mail" value="30"/>
<parameter key="encoding" value="SYSTEM"/>
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="9.6.000" expanded="true" height="68" name="Retrieve Golf" width="90" x="246" y="85">
<parameter key="repository_entry" value="//Samples/data/Golf"/>
</operator>
<operator activated="true" class="execute_script" compatibility="9.6.000" expanded="true" height="82" name="Execute Script" width="90" x="380" y="85">
<parameter key="script" value=" ExampleSet inputData =(ExampleSet) input[0]; String labelName = inputData.getAttributes().getLabel().getName(); operator.getProcess()getMacroHandler().addMacro("macroName",labelName); return inputData;"/>
<parameter key="standard_imports" value="true"/>
</operator>
<connect from_op="Retrieve Golf" from_port="output" to_op="Execute Script" to_port="input 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
</process>
</operator>
</process>
- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany6 -
MartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data ScientistHallo @LeMarc,dieses kleine script setzt mit dieser Zeile:
operator.getProcess()getMacroHandler().addMacro("macroName",labelName);
den Wert des macros macroName auf den namen des Label attributes. du kannst also in allen weiteren operatoren %{macroName} nutzen und wie gewohnt damit arbeiten. Selbstverständlich kannst du auch irgendeinen anderen namen wählen.LG,Martin- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany6
Answers
Dortmund, Germany