Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

Beware Generate Macro's result truncation!

tennenrishintennenrishin Member Posts: 177 Contributor II
edited November 2018 in Help
To whom it may interest

In the following process's output, why is a != b ?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="generate_macro" compatibility="5.3.008" expanded="true" height="60" name="Generate Macro" width="90" x="45" y="30">
        <list key="function_descriptions">
          <parameter key="eps" value="1e-6"/>
        </list>
      </operator>
      <operator activated="true" class="generate_data_user_specification" compatibility="5.3.008" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="246" y="30">
        <list key="attribute_values">
          <parameter key="a" value="1e6*1e-6"/>
          <parameter key="b" value="1e6*%{eps}"/>
        </list>
        <list key="set_additional_roles"/>
      </operator>
      <connect from_op="Generate Data by User Specification" from_port="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>
Because when Generate Macro converts numeric results to strings (as it must) it truncates them according to rapidminer.general.fractiondigits.numbers. You either have to use Set Macro, or change your preferences. Simply quoting doesn't work either, because Generate Macros, unlike Generate Attributes, tries to convert string->number->string.
Sign In or Register to comment.