Changing binominal attribute to numeric

omohsenomohsen Member Posts: 4 Contributor I
edited November 2019 in Help

Hello all,

 

I am wondering if there is any way in Rapidminer to change the type of an attribute from binominal/polynominal to a numeric value.

For example: if I have an attribue called Sex, taking two values: "Male" or "Female".

I want to change the type of this attriube to, let's say an integer value, taking 1 for "Male" and 2 for "Female".

 

** I tried using MAP operator. It changed the value; however, not the type. So, "Male" has been changed to "1" as a string, not 1 as an integer.

If all possible, how to perform such an operation in Rapidminer?

 

Thanks,

Tagged:

Best Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn
    Solution Accepted
    Try a Generate Attributes operator too.
  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    Solution Accepted

    The operator "Nominal to Numeric" will do exactly what you are asking with the parameter option coding type set to "unique integers", but please be careful with this.  For binominals it is fine, but if you map polynominal values of different categories like colors onto numbers like {1,2,3} then you are implying something about the linear relationship and distances between those categories that may not exist in real life.

     

     

    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
Sign In or Register to comment.