The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

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.