Splitting based on the values in an attribute
sectyn
New Altair Community Member
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
So after the split, I want 2 sets:
a test1
d test4
e test5
Tried this in Loop Values, but not sure how to do the split.
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:
0
Best 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
0
Answers
-
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
0 -
Thank you, Balázs. This really helped.
0