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

Is there a way to avoid the loop operator from breaking if there are no records in ExampleSet?

amit_pathakamit_pathak Member Posts: 7 Learner II
I am using the Loop Values Operator in my RM process and there are some instances where the input is an empty ExampleSet. Usually what I have seen in programs is that the loop does not throw errors for empty iterators. Can we achieve the same with RM.

The attribute parameter is 'id' and the iteration macro is 'loop_value'.

Error Message: Process failed: The minimum number of iterations must not be smaller than 1.

Answers

  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Hi!

    Yes, this is the behaviour of some loops in RapidMiner. It can be annoying.

    You can work around this by wrapping the loop in Branch operator with the condition type min_examples = 1.

    Regards,
    Balázs
  • amit_pathakamit_pathak Member Posts: 7 Learner II
    Hi @BalazsBarany, thanks for your reply.

    I did exactly what you suggested. This annoys me more because no matter whether there are records present or not in the `ExampleSet`, the process flow still goes towards the `Loop` operator. I guess I might be doing something wrong which you want to correct.

    As you can see in the below image, for the inputs received by the `Branch` operator I believe it should have not gone toward the `Loop` operator.


  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Hi!

    You can put the Loop inside the Branch operator.

    The Branch operator has two panels. The left one will be executed if the condition evaluates to true (so if the minimum number of examples is 1), the right one in the other case, for an empty dataset.

    In your process you might also want to put Append and Remove Duplicates into the Branch.

    Regards,
    Balázs
  • amit_pathakamit_pathak Member Posts: 7 Learner II
    Found a work-around but I did exactly what you mentioned but still for some reasons could not figure out why it wasn't working as expected.
Sign In or Register to comment.