🎉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

"pivot on two attributes?"

User: "wessel"
New Altair Community Member
Updated by Jocelyn
an example dataset:

year, int
sex, nominal: male, female
age_group, nominal: 0-20, 20-40, 40+
mortality, real

how to convert this dataset into:
year,
mortality_male_0-20,
mortality_male_20-40,
mortality_male_40+, 
mortality_female_0-20,
mortality_female_20-40,
mortality_female_40+

I tried:
Example2AttributePivoting
group_attribute = year
index_attribute = age_group|sex

but index_attribute can only have a single attribute?


Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "wessel"
    New Altair Community Member
    OP
    edit: the above post has been deleted

    eh?

    Aggregation loses information!
    The transformation I have in mind should be lossless.
    Example2AttributePivoting works fine when you only have a single index_attribute.
    There might be some way in Rapidminer to use two "index_attributes". I do not know.

    Example dataset:
    att1 : nominal : {A, B}
    att2 : nominal : {T, F}
    att3 : real
    att4 : real

    Transformed dataset:
    att3_A_T : real
    att3_B_T : real
    att3_A_F : real
    att3_B_F : real
    att4_A_T : real
    att4_B_T : real
    att4_A_F : real
    att4_B_F : real
    User: "land"
    New Altair Community Member
    Hi Wessel,
    there are two possible ways for solving this problem. I will begin with the dirtier one:

    Before applying the Pivoting you could create a new attribute using the AttributeConstruction operator. This nominal attribute would need to store the combination of the values of the attribute sex and age_group. You could then use this single new attribute as index attribute for the Pivoting.

    The second approach would be to ask us for a quote for extending the pivoting operator. This would solve the problem for once and forever but is a little bit more cost intensive :)

    Greetings,
      Sebastian