[SOLVED]sort collection and create intervals

Member Posts: 8 Contributor I
edited November 2018 in Help
Hi,

I have get an collection of example sets (through loop_value Operator).
How can I sort this whole collection by an attribute, which are include in every example set of this collection.
e.g. sort by count of every example set. It's doesn't work with the operator "Sort".

My next Question is:
How can I create an interval? I have data with different time-value and now i would like to assign these values to different intervals e.g. 0-24 hours, 25-48 hours etc.
Further I need an intervall with logarithmic scaling, is this possible in RM?

Thank you for help.

best regards,
Regina

• RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
Hi Regina,

you cannot change the order of a collection.

To create intervals you can use one of the Discretize operators. To create an interval with logarithmic scaling you have to calculate the logarithm manually with Generate Attributes, then again you can use Discretize.

Best regards,
Marius
• Member Posts: 8 Contributor I
Hi Marius,

thank you, that is what I need.

Regarding to the collection, is there any possiblity to get the example set with the highest number of entries?

And can you also say me how I can select and get a specific nominal example of the example set (not in a collection)? I know it works with the index, but I would like to enter the name of the specific example, which I would like to have.

Best regards,
Regina
• RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
Regina wrote:

Regarding to the collection, is there any possiblity to get the example set with the highest number of entries?
Not easily. You could use Loop Collection, do some macro magic with Extract Macro, Generate Macro etc., and finally the Select operator to retrieve the example set. Maybe here it would be better to step back and tell what you actually want to do - maybe there is a more elegant way of doing it instead of getting an example set out of the collection.
`And can you also say me how I can select and get a specific nominal example of the example set (not in a collection)? I know it works with the index, but I would like to enter the name of the specific example, which I would like to have.[/quote]Can you clarify this? I don't fully understand what you want to do. Does Filter Examples help?Best regards,Marius`
• Member Posts: 8 Contributor I
Hi Marius,

I have a collection with 50 example sets. These example sets has variable number of datasets. It exists also an attribute "Count", which is the count of the datasets. I have sorted by this attribute before I generate the collection and I thougth that the collection would be then in this order.
But it is not so.
I would like to create a report with charts of ten example sets which attribute "Count" is the highest.
With "Select" can I select an example set of the collection by index and at index "1" I would like have the example set with the highest "Count", at index "2" the next highest etc.
Or can I get each example sets for reporting on another way?

My secound question was:
I have an example set with many datasets and an nominal attribute "message" (and other attributes). I would like to select the dataset with the message "xy".

thank you
• RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
Hi,

your second question is an easy one, just use Filter Examples and filter on the message attribute.

To your first question: do the example sets have the same attributes? Then I would do the following:
- Append all example sets
- Aggregate, group by Count (no aggregation attributes)
- Sort by count and Generate Id on the output - this will create a ranking of the counts
- Join the ori output of Aggregate with the output of Generate Id, use the Count attribute as Join attribute
- Then use Filter Examples to filter for Id=1, Id=2 etc. to get the desired output.

Quite some steps, but no collection magic required

~Marius
• Member Posts: 8 Contributor I
hi,

[glow=grey,2,300]your second question is an easy one, just use Filter Examples and filter on the message attribute.[/glow]

Sorry, I should have to find out that on my own....

[glow=grey,2,300]To your first question: do the example sets have the same attributes? Then I would do the following:
- Append all example sets
- Aggregate, group by Count (no aggregation attributes)
- Sort by count and Generate Id on the output - this will create a ranking of the counts
- Join the ori output of Aggregate with the output of Generate Id, use the Count attribute as Join attribute
- Then use Filter Examples to filter for Id=1, Id=2 etc. to get the desired output.[/glow]

That idea is very good, I have this integrated in my process

Thank you very muchÂ