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.

Nominal to Binominal

kavuchkavuch Member Posts: 6 Learner III
edited July 2019 in Help
Say I have the following CSV:
color,product
blue,pullover
yellow,shirt
green,pullover
yellow,dress
blue,shoes
blue,pullover
How can I transform the attribute "color" into binominal, so that I get 3 additional attributes like
blue: 0 or 1
yellow: 0 or 1
green: 0 or 1
Tagged:

Answers

  • earmijoearmijo Member Posts: 271 Unicorn
    Of course. Use the operator "Nominal to Numerical" . Make sure coding type is set to dummy coding and you'll get exactly what you want.

    Here's a process with the Golf dataset:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.5.002">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="6.5.002" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="retrieve" compatibility="6.5.002" expanded="true" height="60" name="Retrieve Golf" width="90" x="45" y="165">
            <parameter key="repository_entry" value="//Samples/data/Golf"/>
          </operator>
          <operator activated="true" class="nominal_to_numerical" compatibility="6.5.002" expanded="true" height="94" name="Nominal to Numerical" width="90" x="246" y="165">
            <parameter key="attribute_filter_type" value="single"/>
            <parameter key="attribute" value="Outlook"/>
            <list key="comparison_groups"/>
          </operator>
          <connect from_op="Retrieve Golf" from_port="output" to_op="Nominal to Numerical" to_port="example set input"/>
          <connect from_op="Nominal to Numerical" 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>
Sign In or Register to comment.