Loop Files Operator

7amritaarora7
7amritaarora7 New Altair Community Member
edited November 2024 in Community Q&A

How can we transfer data from loop files operator to data to documents operator?

- The nested processes in loop files operator are working fine

- When I connect it to documents to data, I can't select text attribute in its properties, there isn't any option in the dropdown

- Similarly, I can't set role label

 

Need urgent Help

 

P.S. - I'm trying out the process mentioned in Chapter 14 of the book - RapidMiner - Data Mining Use Cases and Business Analytics Applications by CRC Press, edited by Markus Hofmann and Ralf Klinkenberg

Welcome!

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

Best Answer

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓

    Hey,

     

    what defintly works, but is maybe not the most elegant solution, is using a Loop collection. Attached is a process showing it.

     

    ~Martin

     

    <?xml version="1.0" encoding="UTF-8"?><process version="7.2.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="7.2.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="loop" compatibility="7.2.001" expanded="true" height="82" name="Loop" width="90" x="112" y="34">
    <parameter key="set_iteration_macro" value="true"/>
    <process expanded="true">
    <operator activated="true" class="text:create_document" compatibility="7.2.000" expanded="true" height="68" name="Create Document" width="90" x="246" y="85">
    <parameter key="text" value="abc %{iteration}"/>
    </operator>
    <connect from_op="Create Document" from_port="output" to_port="output 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="loop_collection" compatibility="7.2.001" expanded="true" height="82" name="Loop Collection" width="90" x="246" y="34">
    <process expanded="true">
    <operator activated="true" class="text:documents_to_data" compatibility="7.2.000" expanded="true" height="82" name="Documents to Data" width="90" x="112" y="34">
    <parameter key="text_attribute" value="text"/>
    </operator>
    <connect from_port="single" to_op="Documents to Data" to_port="documents 1"/>
    <connect from_op="Documents to Data" from_port="example set" to_port="output 1"/>
    <portSpacing port="source_single" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="append" compatibility="7.2.001" expanded="true" height="82" name="Append" width="90" x="380" y="34"/>
    <connect from_op="Loop" from_port="output 1" to_op="Loop Collection" to_port="collection"/>
    <connect from_op="Loop Collection" from_port="output 1" to_op="Append" to_port="example set 1"/>
    <connect from_op="Append" from_port="merged set" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    </process>
    </operator>
    </process>

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee

    Hi,

     

    have you tried to use an append operator?

    Otherwise could you maybe post your process please?

     

    ~Martin

  • 7amritaarora7
    7amritaarora7 New Altair Community Member

    Hi

     

    I'm attaching the process here, please have a look

     

    Amrita

  • 7amritaarora7
    7amritaarora7 New Altair Community Member

    @mschmitz any solution?

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓

    Hey,

     

    what defintly works, but is maybe not the most elegant solution, is using a Loop collection. Attached is a process showing it.

     

    ~Martin

     

    <?xml version="1.0" encoding="UTF-8"?><process version="7.2.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="7.2.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="loop" compatibility="7.2.001" expanded="true" height="82" name="Loop" width="90" x="112" y="34">
    <parameter key="set_iteration_macro" value="true"/>
    <process expanded="true">
    <operator activated="true" class="text:create_document" compatibility="7.2.000" expanded="true" height="68" name="Create Document" width="90" x="246" y="85">
    <parameter key="text" value="abc %{iteration}"/>
    </operator>
    <connect from_op="Create Document" from_port="output" to_port="output 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="loop_collection" compatibility="7.2.001" expanded="true" height="82" name="Loop Collection" width="90" x="246" y="34">
    <process expanded="true">
    <operator activated="true" class="text:documents_to_data" compatibility="7.2.000" expanded="true" height="82" name="Documents to Data" width="90" x="112" y="34">
    <parameter key="text_attribute" value="text"/>
    </operator>
    <connect from_port="single" to_op="Documents to Data" to_port="documents 1"/>
    <connect from_op="Documents to Data" from_port="example set" to_port="output 1"/>
    <portSpacing port="source_single" spacing="0"/>
    <portSpacing port="sink_output 1" spacing="0"/>
    <portSpacing port="sink_output 2" spacing="0"/>
    </process>
    </operator>
    <operator activated="true" class="append" compatibility="7.2.001" expanded="true" height="82" name="Append" width="90" x="380" y="34"/>
    <connect from_op="Loop" from_port="output 1" to_op="Loop Collection" to_port="collection"/>
    <connect from_op="Loop Collection" from_port="output 1" to_op="Append" to_port="example set 1"/>
    <connect from_op="Append" from_port="merged set" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    </process>
    </operator>
    </process>
  • 7amritaarora7
    7amritaarora7 New Altair Community Member
    Hey Martin

    Thanks a lot! :)
    Will add it to the process, hopefully no other issues arise.

    Regards
    Amrita

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.