Options

Transforming and Creating New Attributes in RM

Gabriel_CornejoGabriel_Cornejo Member Posts: 2 Contributor I
edited November 2018 in Help
Hello Everyone:

I want to know if one of you can helpme. I have an attribute whose name is children, some of the rows have numbers like -7 for instance. How can I change them to 0 which is the mode?

My other question it is about to create new attrbutes. I have 2 variables, one of them it is Amount of Purchase, the other it in Number of Purchase. With 2 variables I want to generate a new one called Average Purchase, which it is a quotient between them. How do I do that?

Thanks

Gabriel
CHILE

Answers

  • Options
    Nils_WoehlerNils_Woehler Member Posts: 463 Maven
    Hi Gabriel,

    both ouf your aims can be achieved with the 'Generate Attributes' Operator.
    I think this example can help you to understand how:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.1.014">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.1.014" expanded="true" name="Process">
        <process expanded="true" height="314" width="614">
          <operator activated="true" class="generate_data" compatibility="5.1.014" expanded="true" height="60" name="Generate Data" width="90" x="112" y="210">
            <parameter key="target_function" value="two gaussians classification"/>
            <parameter key="number_of_attributes" value="3"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="5.1.014" expanded="true" height="76" name="Generate Attributes" width="90" x="313" y="210">
            <list key="function_descriptions">
              <parameter key="Average Purchase" value="att1/att2"/>
            </list>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="5.1.014" expanded="true" height="76" name="Generate Attributes (2)" width="90" x="514" y="210">
            <list key="function_descriptions">
              <parameter key="Filtered Attribute" value="if(att3&lt;0,0,att3)"/>
            </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_op="Generate Attributes (2)" to_port="example set input"/>
          <connect from_op="Generate Attributes (2)" 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>
    Regards,
    Nils
Sign In or Register to comment.