Options

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

amit_pathakamit_pathak Member Posts: 7 Contributor I
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

  • Options
    BalazsBaranyBalazsBarany Administrator, Moderator, Employee, 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
  • Options
    amit_pathakamit_pathak Member Posts: 7 Contributor I
    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.


  • Options
    BalazsBaranyBalazsBarany Administrator, Moderator, Employee, 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
  • Options
    amit_pathakamit_pathak Member Posts: 7 Contributor I
    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.