How can i do to change integer values in more than 1 attribute?

cdapontecdaponte Member Posts: 29 Maven
I have an example set with 5 attributes that are number in a reduce scale of thounsands, i want to multiply all the values for 1000. For example: the value is 20, but i want to do 20*1000 and i want to do that in all the values of 5 attributes. Can you help me? Thanks in advanced

Best Answer

Answers

  • lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    Hi @cdaponte

    If I good understand, you will need of Generate Attributes operator for this task.
    The name of the generated attribute has to be strictly the same that the name of the original attribute.

    Hope this helps,

    Regards,

    Lionel
  • cdapontecdaponte Member Posts: 29 Maven
    Yes, i considered that option, but it i have 5 attributes that require this process, so i have to use 5 different generatte attributes, or there is a way to integrate all with one operator?
  • varunm1varunm1 Moderator, Member Posts: 1,207 Unicorn
    Hello @cdaponte

    You don't need five generate attribute operators, you can create all of them in one. Here is the XML code for you to check.

    <?xml version="1.0" encoding="UTF-8"?><process version="9.4.001">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process" origin="GENERATED_TUTORIAL">
        <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.4.001" expanded="true" height="68" name="Retrieve Polynomial" width="90" x="112" y="85">
            <parameter key="repository_entry" value="//Samples/data/Polynomial"/>
          </operator>
          <operator activated="true" breakpoints="before,after" class="generate_attributes" compatibility="9.4.001" expanded="true" height="82" name="Generate Attributes" width="90" x="313" y="85">
            <list key="function_descriptions">
              <parameter key="a1" value="a1*1000"/>
              <parameter key="a2" value="a2*1000"/>
              <parameter key="a3" value="a3*1000"/>
              <parameter key="a4" value="a4*1000"/>
              <parameter key="a5" value="a5*1000"/>
            </list>
            <parameter key="keep_all" value="false"/>
          </operator>
          <connect from_op="Retrieve Polynomial" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
          <connect from_op="Generate Attributes" 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>
    
    Hope this helps

    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

  • cdapontecdaponte Member Posts: 29 Maven
    haha yes is cooler with a loop @IngoRM
    Thanks!
Sign In or Register to comment.