For Loop implementation

sectyn
sectyn New Altair Community Member
edited November 2024 in Community Q&A
I'm looking to implement something like a 'for loop' in RapidMiner. The input to the 'for loop' will be a dataset of say 5 attributes. For each run of the 'for loop', I need to add one new attribute. So if the 'for loop' runs 5 times, I end up with a dataset of 10 attributes. With the Loop operator the dataset that goes into the loop is the initial one with 5 attributes. How do I append attributes for each run and get that new dataset with the additional attribute as the input for the next run of my Loop operator? Or should I be using some other operator for this?
Tagged:

Best Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    Hi,
    you likely want to use the normal Loop with the "reuse results" option.

    Best,
    Martin
  • kayman
    kayman New Altair Community Member
    Answer ✓
    You can do as follows : 

    Use the loop operator -> Number of iterations = 5 and ensure you select 'reuse results'
    In the loop operator add 'generate attribute' and use the iteration value (1 to 5) or use a macro to generate something more fancy.

    Attached some example to get you started

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓
    Hi,
    you likely want to use the normal Loop with the "reuse results" option.

    Best,
    Martin
  • kayman
    kayman New Altair Community Member
    Answer ✓
    You can do as follows : 

    Use the loop operator -> Number of iterations = 5 and ensure you select 'reuse results'
    In the loop operator add 'generate attribute' and use the iteration value (1 to 5) or use a macro to generate something more fancy.

    Attached some example to get you started

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.