Splitting based on the values in an attribute

sectyn
sectyn New Altair Community Member
edited November 2024 in Community Q&A
I have a set of rows with missing values in one attribute. I would like to split the data based on the attribute with missing values in such a way that the sets will have rows upto the row which has some value in that attribute.
 
For example if the example set is:

Att1   Att2    Att3

a      test1   
b      test2   
c      test3    val3
d      test4
e      test5
f      test6
g      test7    val7
h      test8
i        test9

So after the split, I want 2 sets:

a     test1   
b     test2  
c      test3    val3

d     test4
e     test5
f      test6
g     test7    val7

Tried this in Loop Values, but not sure how to do the split.




Tagged:

Best Answer

  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Answer ✓
    Hi @jennyclub,

    this kind of row-spanning processing is quite hard in RapidMiner.

    I would try something like this:
    1. Get the the index of non-empty Att3 values. E. g. Generate ID, Filter Examples. 
    2. Loop the filtered index values (they need to be converted into nominal) and filter the other rows based ID <= current index. 
    3. Extract the current Att3 value with Extract Macro and write it into the filtered table with Generate Attributes.

    I hope this gives you an idea.

    Regards,

    Balázs

Answers

  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Answer ✓
    Hi @jennyclub,

    this kind of row-spanning processing is quite hard in RapidMiner.

    I would try something like this:
    1. Get the the index of non-empty Att3 values. E. g. Generate ID, Filter Examples. 
    2. Loop the filtered index values (they need to be converted into nominal) and filter the other rows based ID <= current index. 
    3. Extract the current Att3 value with Extract Macro and write it into the filtered table with Generate Attributes.

    I hope this gives you an idea.

    Regards,

    Balázs

  • sectyn
    sectyn New Altair Community Member
    Thank you, Balázs. This really helped.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.