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.

Operator with conditional value

vhromerovhromero Member Posts: 4 Contributor I
edited November 2018 in Help

Hi,

I have an attribute named order_status with 4 possible values: cancelled, pending, processing and processed
and I would like to generate a new attribute named 'label'
with this condition:

if (order_status = 'cancelled' or 'pending')
  value = 'purchased'
THEN
  value = 'not purchased'

Any advice will be appreciate

I am not sure what operator to use and how to implement this condition

Thank you

Answers

  • awchisholmawchisholm RapidMiner Certified Expert, Member Posts: 458 Unicorn
    Hello

    Use the 'generate attributes' operator with a suitable if then else. You're very close with your example.

    Regards,

    Andrew
  • vhromerovhromero Member Posts: 4 Contributor I
    Hi Andrew,

    Thanks!

    Done with the Operator Generate Attribute: 
    if(matches(order_status, "processing") || matches(order_status, "processed"), "COMPRADO", "NO COMPRADO")

    Now, how can hide/delete the order_status  attribute?

    Thank you
  • swissrussswissruss RapidMiner Certified Expert, Member Posts: 11 Contributor II
    Hi,

    'Select Attributess' with the single attribute setting, 'order_status' and 'invert selection' ticked should get rid of it.

    Regards,

    Russ
Sign In or Register to comment.