What should be the correct type of a nominal attribute coded 0 and 1?

CuriousCurious Member Posts: 12 Newbie
edited February 4 in Help
If an attribute has two possible values (their 'meaning' is nominal) but they are already coded as 0 and 1, then is it OK to just set the type as integer or should I set it as binominal and then transform it back to numeric in the process?

Best Answer

Answers

  • rfuentealbarfuentealba Moderator, RapidMiner Certified Analyst, Member, University Professor Posts: 394   Unicorn

    If their meaning is nominal and you can indistinctly set 0/1, on/off, in/out, yes/no, then these are binominals, not proper numbers (e.g. these aren't meant to be used in mathematical operations), so you might safely set these as binominals. On the other hand, if you will make use of these numbers in math operations, you would prefer to make these integers.

    Be careful, because while changing numerical to binominal converts 0's to false and 1's to true, changing binominal to numerical creates something like this instead of your original data:

    I always forget to use Parse Numbers instead, which does provide me numbers from nominal attributes. Just make sure your data does not include characters other than numeric ones.

    Hope this helps.

    Rodrigo.


    eackley29sgenzer
  • CuriousCurious Member Posts: 12 Newbie
    Hi Rodrigo,

    Thank you so much for your answer! Just one more thing: can you specify what you exactly mean by 'mathematical operations'?

    Thank you!
  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,210   Unicorn
    Don't forget you can use "Numerical to Binominal" and turn ANY numerical data into a simple binominal by setting a threshold value.  This works for attributes that are already coded as 0/1 or continuous numbers as well. It will give you a single column with values of "true" and "false" based on the threshold you define.  See the tutorial process using the Sonar data for an example.
    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
    eackley29rfuentealba
Sign In or Register to comment.