🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Assigning class based on multiple attributes

User: "b00122599"
New Altair Community Member
Updated by Jocelyn
Hey folks,

Sorry looking for help on how to start a problem. I have a CSV file with 15 attributes all of which are numeric with a range of 1-20 for each attribute. I want to create a classification based on which attribute is scored 20. Only one of the attributes per each record should be scored 20. I only want to have 4 classs for example Man, Woman, Boy, Girl, so if one of the first three atrributes is 20 then I want to classify it as a Man, if one of attributes four to six is 20 I want classifiy it as a woman. I hope this makes sense, any help is much appreciated.

Neil.

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "varunm1"
    New Altair Community Member
    Accepted Answer
    Updated by varunm1
    Hi Neil, @b00122599

    So you are trying to create a new column with one of the four classes based on a value in attributes. If this is what you are trying to do,  You can use "generate attribute" operator with expression using IF statement and write nested if functions. If you can inform you attribute names and conditions like which attributes should be compared for Man etc. we can help. Sample Nested If statement which might be useful is below. Please correct me if my understanding is not correct. a1, a2 .. are attribute 1, 2 ...

    if (a1==20, "Man", if (a2==20, "Man", if (a3==20, "Man", if (a4==20, "Women", if (a5==20, "Women", if (a6==20, "Women", "Boy"))))))
    The above expression is IF a1 is 20 then "Man" else it will check a2, similarly all the nested statements until any condition is satisfied.

    Thanks