"[Solved] Generate macro thows error on calculating with macros"

qwertz2qwertz2 Member Posts: 49 Guru
edited June 2019 in Help

 

Dear all,

 

In a former version of Rapidminer it was possible to calculate with macros inside the "generate macro" operator (e.g. %{macro}+5). However, in the latest version it the latest version it says "must have arguments of type numerical".

 

Of course I could set back compatibility level but I was wondering whether there is another way of transformation as I like to stay on the latest version.

 

Best regards

Sachs

 

 

<?xml version="1.0" encoding="UTF-8"?><process version="7.5.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.5.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="generate_data" compatibility="7.5.000" expanded="true" height="68" name="Generate Data" width="90" x="45" y="34"/>
<operator activated="true" class="extract_macro" compatibility="7.5.000" expanded="true" height="68" name="Extract Macro" width="90" x="179" y="34">
<parameter key="macro" value="last"/>
<list key="additional_macros"/>
</operator>
<operator activated="true" class="generate_macro" compatibility="7.5.000" expanded="true" height="82" name="Generate Macro" width="90" x="313" y="34">
<list key="function_descriptions">
<parameter key="first" value="%{last}-9"/>
</list>
</operator>
<operator activated="true" class="filter_example_range" compatibility="7.5.000" expanded="true" height="82" name="Filter Example Range" width="90" x="447" y="34">
<parameter key="first_example" value="%{first}"/>
<parameter key="last_example" value="%{last}"/>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Extract Macro" to_port="example set"/>
<connect from_op="Extract Macro" from_port="example set" to_op="Generate Macro" to_port="through 1"/>
<connect from_op="Generate Macro" from_port="through 1" to_op="Filter Example Range" to_port="example set input"/>
<connect from_op="Filter Example Range" from_port="example set output" 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>
Tagged:

Best Answer

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist
    Solution Accepted

    Hi,

     

    have a look at the eval function. this should do the trick.

     

    ~Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany

Answers

Sign In or Register to comment.