[Solved]Add a constant to numerical attribute

aryan_hosseinzaaryan_hosseinza Member Posts: 74 Contributor II
Hi everybody ,

I have a numerical field (attribute) and I want to add a constant to it (e.g. 1) , I don't to loop over anything myself , is there any straight forward solution ?

Thanks ,
Arian  

Answers

  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869   Unicorn
    Hi Arian,

    Generate Attributes will do that for you. Please have a look at the attached process.

    Best regards,
    Marius
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.2.008">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
        <process expanded="true" height="116" width="480">
          <operator activated="true" breakpoints="after" class="generate_data" compatibility="5.2.008" expanded="true" height="60" name="Generate Data" width="90" x="179" y="30">
            <parameter key="number_of_attributes" value="1"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="5.2.008" expanded="true" height="76" name="Generate Attributes" width="90" x="380" y="30">
            <list key="function_descriptions">
              <parameter key="att1" value="att1+1"/>
            </list>
          </operator>
          <connect from_op="Generate Data" 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>
  • aryan_hosseinzaaryan_hosseinza Member Posts: 74 Contributor II
    Thanks , it works .

Sign In or Register to comment.