select subprocess

sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,446  Community Manager
edited June 4 in Help
I'd like to name the subprocesses and then select via that name, rather than use the 1,2,3,... option.

Scott

Answers

  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,131  RM Data Scientist
    You are right, that would be nice

    Is there any particular use case? Or just because it is easier to track for the analyst?

    Cheers,

    Martin
    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
  • sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,446  Community Manager
    Sure Martin.  Here's an example:

    I have a data set that has three categories: Math, Reading and Language Usage.  I need to do processing differently depending on which one it is.  Right now I have to create a "Selector" macro that is a large "if" statement, converting Math, Reading and Language Usage to 1,2,3 for Select Subprocess.  Furthermore, once I'm in the subprocess, the headers in each window say "Selection1" "Selection 2" and "Selection 3" rather than "Math" "Reading" "Language Usage".  I usually cheat the system and place a Set Macro operator in each window which does nothing but carry the name "Math" (hence related to my labeling request from earlier).  Here's an excerpt of something similar:
     <operator activated="true" class="generate_macro" compatibility="6.3.000" expanded="true" height="76" name="Generate Macro (3)" width="90" x="313" y="30">
                   <list key="function_descriptions">
                     <parameter key="Test_Type_Test_Num" value="if(matches(&quot;%{Test_Type_Test}&quot;,&quot;Process&quot;),round(1),if(matches(&quot;%{Test_Type_Test}&quot;,&quot;Aspect&quot;),round(2),round(3)))"/>
                   </list>
                 </operator>
                 <operator activated="true" class="generate_macro" compatibility="6.3.000" expanded="true" height="76" name="Generate Macro (6)" width="90" x="313" y="120">
                   <list key="function_descriptions">
                     <parameter key="Selector" value="str(%{Test_Type_Test_Num})"/>
                   </list>
                 </operator>
                 <operator activated="true" class="select_subprocess" compatibility="6.3.000" expanded="true" height="76" name="Select Subprocess" width="90" x="447" y="120">
                   <parameter key="select_which" value="%{Selector}"/>
                   <parameter key="parallelize_selection_1" value="true"/>
                   <parameter key="parallelize_selection_2" value="true"/>
                   <process expanded="true">
    </operator>
    Thanks.

    Scott
  • sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,446  Community Manager
    Here's another that chooses a subprocess based on filename characteristics:
      <operator activated="true" class="subprocess" compatibility="6.3.000" expanded="true" height="76" name="Get files" width="90" x="45" y="345">
            <process expanded="true">
              <operator activated="true" class="loop_files" compatibility="6.3.000" expanded="true" height="76" name="Set file directory" width="90" x="112" y="30">
                <parameter key="directory" value="%{FolderDirectory}"/>
                <parameter key="filter" value="Ass.*.csv|Class.*.csv|Spec.*.csv|Stud.*.csv"/>
                <process expanded="true">
                  <operator activated="true" class="generate_data_user_specification" compatibility="6.3.000" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="179" y="30">
                    <list key="attribute_values">
                      <parameter key="FileName" value="&quot;%{file_name}&quot;"/>
                    </list>
                    <list key="set_additional_roles"/>
                  </operator>
                  <connect from_op="Generate Data by User Specification" from_port="output" to_port="out 1"/>
                  <portSpacing port="source_file object" spacing="0"/>
                  <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="append" compatibility="6.3.000" expanded="true" height="76" name="Append (3)" width="90" x="246" y="30"/>
              <operator activated="true" class="generate_copy" compatibility="6.3.000" expanded="true" height="76" name="Generate Copy of FileName" width="90" x="380" y="30">
                <parameter key="attribute_name" value="FileName"/>
                <parameter key="new_name" value="Selector"/>
              </operator>
              <operator activated="true" class="map" compatibility="6.3.000" expanded="true" height="76" name="Create Selector Numbers" width="90" x="514" y="30">
                <parameter key="attribute_filter_type" value="single"/>
                <parameter key="attribute" value="Selector"/>
                <list key="value_mappings">
                  <parameter key="AssessmentResults.csv" value="2"/>
                  <parameter key="ClassAssignments.csv" value="3"/>
                  <parameter key="StudentBySchool.csv" value="4"/>
                  <parameter key="SpecialProgramAssignments.csv" value="5"/>
                </list>
                <parameter key="replace_what" value="AccommodationAssignment.csv"/>
                <parameter key="replace_by" value="1"/>
              </operator>
              <operator activated="true" class="loop_values" compatibility="6.3.000" expanded="true" height="76" name="Loop Values" width="90" x="648" y="30">
                <parameter key="attribute" value="FileName"/>
                <process expanded="true">
                  <operator activated="true" class="filter_examples" compatibility="6.3.000" expanded="true" height="94" name="Filter FileName" width="90" x="45" y="30">
                    <list key="filters_list">
                      <parameter key="filters_entry_key" value="FileName.equals.%{loop_value}"/>
                    </list>
                  </operator>
                  <operator activated="true" class="extract_macro" compatibility="6.3.000" expanded="true" height="60" name="Extract FileName" width="90" x="179" y="30">
                    <parameter key="macro" value="FileName"/>
                    <parameter key="macro_type" value="data_value"/>
                    <parameter key="attribute_name" value="FileName"/>
                    <parameter key="example_index" value="1"/>
                    <list key="additional_macros">
                      <parameter key="Selector" value="Selector"/>
                    </list>
                  </operator>
                  <operator activated="true" class="select_subprocess" compatibility="6.3.000" expanded="true" height="76" name="Select Import CSV schema" width="90" x="313" y="30">
                    <parameter key="select_which" value="%{Selector}"/>
                    <process expanded="true">
                      <operator activated="true" class="read_csv" compatibility="6.3.000" expanded="true" height="60" name="Read new AccommodationAssignment (2)" width="90" x="45" y="30">
                        <parameter key="csv_file" value="%{parent_path}/AccommodationAssignment.csv"/>
                        <parameter key="column_separators" value=","/>
                        <parameter key="date_format" value="MM/dd/yyyy"/>
                        <list key="annotations"/>
                        <list key="data_set_meta_data_information">
                          <parameter key="0" value="TermName.false.nominal.attribute"/>
                          <parameter key="1" value="AssessmentGUID.true.polynominal.attribute"/>
                          <parameter key="2" value="StudentIdentifier.true.nominal.id"/>
                          <parameter key="3" value="AssessmentAccommodationCategory.true.polynominal.attribute"/>
                          <parameter key="4" value="AssessmentAccommodationType.true.polynominal.attribute"/>
                        </list>
                      </operator>
                      <operator activated="true" class="remember" compatibility="6.3.000" expanded="true" height="60" name="Remember AccommodationAssignment" width="90" x="45" y="120">
                        <parameter key="name" value="AccommodationAssignment"/>
                      </operator>
                      <connect from_op="Read new AccommodationAssignment (2)" from_port="output" to_op="Remember AccommodationAssignment" to_port="store"/>
                      <connect from_op="Remember AccommodationAssignment" from_port="stored" to_port="output 1"/>
                      <portSpacing port="source_input 1" spacing="0"/>
                      <portSpacing port="source_input 2" spacing="0"/>
                      <portSpacing port="sink_output 1" spacing="0"/>
                      <portSpacing port="sink_output 2" spacing="0"/>
                    </process>
Sign In or Register to comment.