The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[SOLVED] Number of Examples in Set
Hi,
I have data in ExampleSet like :
And now, I need to cut data, that every same name in specific ID is occurs max twice.
The wanted result is:
Is that possible in RapidMiner? Any regular expression or something.
Thanks,
Regards,
John
I have data in ExampleSet like :
ID | NAME | VALUE |
1 | Bob | 123.0 |
1 | Bob | 456.4 |
1 | Bob | 4786.4 |
1 | Alice | 333.4 |
1 | Brad | 88.4 |
2 | Jacob | 353.4 |
2 | Jacob | 663.4 |
2 | Jacob | 633.4 |
The wanted result is:
ID | NAME | VALUE |
1 | Bob | 123.0 |
1 | Bob | 456.4 |
1 | Alice | 333.4 |
1 | Brad | 88.4 |
2 | Jacob | 353.4 |
2 | Jacob | 663.4 |
Thanks,
Regards,
John
0
Answers
yes it is possible, but currently I can't think of a way of doing it without the "Execute Script" operator. Basically iterate over the sorted example set, count the number of same names, then flag every example which should be removed and afterwards remove all flagged examples.
Though you might want and try to come up with something clever using macros (as counter variables) and the "Branch" operator, it might very well be possible
Regards,
Marco
Execution Script seems like a powerful tool. Thanks a lot. I wrote something like that: But it throws Exceptions, that something is wrong with method Remove (seems like a parser doesnt know her). Do you know, how can I remove an Example and at the end returns this new ExampleSet to output port? You were talking about flags. What do you mean?
Thanks,
Regards,
John
I have changed a method according to IOObject.remove(T class) implementation to exampleSet.remove(example) (from example above), and Exceptions are gone. But the Operator doesnt return the ExampleSet.
MODIFIED:
ok now, i can return the ExampleSet, but the method remove is wrong. Without remove method the process proceed well, but I need this method or similar to remove specific Example.
Thanks,
Regards,
John
you can use the "Filter Examples" operator. Set condition class parameter to "attribute_value_filter" and then simply put in "NAME!=-1" (without the quotes)
Regards,
Marco
Regards,
John