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

"Looping over an Operator"

Rick_VRick_V Member Posts: 1 Learner III
edited June 2019 in Help
Hello there :)

I'm new to RapidMiner and had a question, regarding looping. I searched the web but couldn't find a solution...

What I want to do is, for a specific Log, use a Control-Flow Miner (like the Alpha Algorithm Miner) but also add noise to the log. I want to add noise on different percentages, 0%, 10%, 20%...100%, so for each 'Noise Type' i want to have 11 different outcomes. I don't know how to loop this operation... Can someone help me? It is very inefficient do create 11 different paths... And keep changing stuff around.

I added my process in this image: image

Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data Scientist
    hi,

    Loop Values is your friend. Sadly you need to use a remember recall construct.
    The attached process show the procedure. It's annotated which should help.

    ~Martin

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.4.000">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="6.4.000" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="generate_data" compatibility="6.4.000" expanded="true" height="60" name="Generate Data (2)" width="90" x="246" y="390">
            <parameter key="attributes_lower_bound" value="0.0"/>
            <parameter key="attributes_upper_bound" value="100.0"/>
          </operator>
          <operator activated="true" class="remember" compatibility="6.4.000" expanded="true" height="60" name="Remember" width="90" x="380" y="390">
            <parameter key="name" value="tempObject"/>
          </operator>
          <operator activated="true" class="subprocess" compatibility="6.4.000" expanded="true" height="76" name="Subprocess" width="90" x="45" y="165">
            <process expanded="true">
              <operator activated="true" class="generate_data" compatibility="6.4.000" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30">
                <parameter key="number_examples" value="10"/>
              </operator>
              <operator activated="true" class="generate_id" compatibility="6.4.000" expanded="true" height="76" name="Generate ID" width="90" x="179" y="30"/>
              <operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="76" name="Generate Attributes" width="90" x="313" y="30">
                <list key="function_descriptions">
                  <parameter key="percentage" value="id*10"/>
                </list>
              </operator>
              <operator activated="true" class="select_attributes" compatibility="6.4.000" expanded="true" height="76" name="Select Attributes" width="90" x="447" y="30">
                <parameter key="attribute_filter_type" value="single"/>
                <parameter key="attribute" value="percentage"/>
                <parameter key="include_special_attributes" value="true"/>
              </operator>
              <connect from_op="Generate Data" from_port="output" to_op="Generate ID" to_port="example set input"/>
              <connect from_op="Generate ID" from_port="example set output" to_op="Generate Attributes" to_port="example set input"/>
              <connect from_op="Generate Attributes" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
              <connect from_op="Select Attributes" from_port="example set output" to_port="out 1"/>
              <portSpacing port="source_in 1" spacing="0"/>
              <portSpacing port="sink_out 1" spacing="0"/>
              <portSpacing port="sink_out 2" spacing="0"/>
            </process>
          </operator>
          <operator activated="true" class="numerical_to_polynominal" compatibility="6.4.000" expanded="true" height="76" name="Numerical to Polynominal" width="90" x="313" y="165">
            <parameter key="attribute_filter_type" value="single"/>
            <parameter key="attribute" value="percentage"/>
          </operator>
          <operator activated="true" class="loop_values" compatibility="6.4.000" expanded="true" height="76" name="Loop Values" width="90" x="581" y="165">
            <parameter key="attribute" value="percentage"/>
            <parameter key="iteration_macro" value="noiseLevel"/>
            <process expanded="true">
              <operator activated="true" class="recall" compatibility="6.4.000" expanded="true" height="60" name="Recall" width="90" x="45" y="120">
                <parameter key="name" value="tempObject"/>
                <parameter key="remove_from_store" value="false"/>
              </operator>
              <operator activated="true" class="filter_examples" compatibility="6.4.000" expanded="true" height="94" name="Filter Examples" width="90" x="313" y="120">
                <list key="filters_list">
                  <parameter key="filters_entry_key" value="att1.le.%{noiseLevel}"/>
                </list>
              </operator>
              <connect from_op="Recall" from_port="result" to_op="Filter Examples" to_port="example set input"/>
              <connect from_op="Filter Examples" from_port="example set output" to_port="out 1"/>
              <portSpacing port="source_example set" spacing="0"/>
              <portSpacing port="sink_out 1" spacing="0"/>
              <portSpacing port="sink_out 2" spacing="0"/>
              <description align="center" color="yellow" colored="false" height="199" resized="true" width="245" x="254" y="59">Do you work on the example set</description>
              <description align="center" color="yellow" colored="false" height="178" resized="true" width="202" x="10" y="67">Be sure not to delete that item</description>
            </process>
          </operator>
          <connect from_op="Generate Data (2)" from_port="output" to_op="Remember" to_port="store"/>
          <connect from_op="Subprocess" from_port="out 1" to_op="Numerical to Polynominal" to_port="example set input"/>
          <connect from_op="Numerical to Polynominal" from_port="example set output" to_op="Loop Values" to_port="example set"/>
          <connect from_op="Loop Values" from_port="out 1" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="144"/>
          <portSpacing port="sink_result 2" spacing="0"/>
          <description align="center" color="yellow" colored="false" height="255" resized="true" width="195" x="10" y="59">Generate Data with the desired percentages. You can also use Read Excel or the Data editor</description>
          <description align="center" color="yellow" colored="false" height="270" resized="true" width="308" x="212" y="50">Loop Values needs polynominal values. That does not matter that much, because we use it as a macro anyway</description>
          <description align="center" color="yellow" colored="false" height="224" resized="true" width="325" x="205" y="338">This is the data you want to apply the process in the loop. Please take care of the excecution order</description>
        </process>
      </operator>
    </process>
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
Sign In or Register to comment.