convert values

bookitsabookitsa Member Posts: 15 Contributor I
Hello! I have a dataset where the content  of an attribute has only 2 values: 2 and 4. I want to convert these 2 values in yes and no. Note that this attribute has the role label as well.Thank you for your help!

Best Answer

Answers

  • tftemmetftemme Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, RMResearcher, Member Posts: 164 RM Research
    Hi @bookitsa,

    You can also use the Generate Attribute operator. For the attribute name you choose the old attribute name (it will be overwritten with the new values. For the function expression, you use:

    if ([attribute name] == 2, "yes", "no")

    Of course you have to replace [attribute name] with your own attribute name (and maybe change "yes" and "no" if the 4 should be converted to a "yes"

    Best regards,
    Fabian

    MartinLiebigvarunm1sgenzer
  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    You can also use the Nominal to BInominal Operator if you are trying to make it specifically a binominal type attribute (which is often the case for labels).
    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
    sgenzer
  • bookitsabookitsa Member Posts: 15 Contributor I
    edited January 2019
    Thank you all for your responses! The one that solved my problem was from @varunm1! Thank you again all of you!!
    varunm1sgenzer
Sign In or Register to comment.