The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 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.
Options

"Iteration macro inside Loop collection"

monami555monami555 Member Posts: 16 Contributor II
edited June 2019 in Help
Hello

Maybe someone knows how to solve my problem: I have a collection of n ExampleSets and a collection of n Models. I want to apply n-th model to corresponding n-th ExampleSet, so I have to loop through two collections in parallel.

After trying a lot of things, I found out that the most logical way would be storing one collection with "Remember" operator, and then loop through the other one, "Recalling" the first one and selecting the n-th item on each loop.

The problem is how to select the n-th item inside the collection loop.

Most loops have the "iteration macro" parameter, which is exactly what I am looking for - however the "Loop collection" operator lacks this parameter.

I also cannot find a way to loop through a collection of items using different operator than "Loop collection". "Loop until" seems reasonable, but how to specify "input collection is empty" condition?

Is there any way to do that?

Monika

Answers

  • Options
    monami555monami555 Member Posts: 16 Contributor II
    Strange but usual thing, a few days of unsuccesful trying, posting the question in forum and the solution found after another few minutes :)

    I can set a macro before the loop and then re-generate it inside each loop using "Generate macro" operator and putting %{macro_name}+1 as the macro value.

    Anyway I find it strange if there was no more straightforward way..
Sign In or Register to comment.