Options

"rename the extension

WinKadWinKad Member Posts: 9 Contributor II
edited May 2019 in Help
Hi,
how can be called the colums with the extension "...-0" after windowing with label1, label2 etc.?
I suppose with loop or macro.(?)

The new version of RM is now an invitation to learning by doing - a great tool!

Greating to Dortmund
WinKad
Tagged:

Answers

  • Options
    colocolo Member Posts: 236 Maven
    Hi WinKad,

    perhaps the operator "Rename by Replacing" could be used to do this job. If you keep the last number from the original attribute names this might work.

    Regards,
    Matthias
  • Options
    WinKadWinKad Member Posts: 9 Contributor II
    Hi Matthias,
    excuse me, I see, my question was not correct. What I mean is not to change the name but with "Set Role" to set label1, label2 etc.
    I think, this can be done with macro, but I don't know how to do this. There are plenty changes to be done.
    Beside this, where can I get a deeper information about the usage of macros?
    Till now, I solve this problem by hand: under a "Subprocess" I set the endings with "-0" after windowing by chaining SetRoles for label01, for label02 and so on.
    And thanks for your reply.
    Greetings from Göttingen
    Winkad
  • Options
    RichyRichy Member Posts: 20 Contributor II
    WinKad wrote:
    Beside this, where can I get a deeper information about the usage of macros?
    Hi

    I'm new to rapidminer too and I'm using the MyExperimentBrowser view (need to install the Community extension) to look at examples. It helped me a lot to understand the usage of macros.
  • Options
    SebastianLohSebastianLoh Member Posts: 99 Contributor II
    Hi WinKad,

    I didn't extactly understood what you'd like to do. Colud you post a simple process which explains your problem please?

    Ciao Sebastian
  • Options
    WinKadWinKad Member Posts: 9 Contributor II
    Hi, Sebastian,
    I can't understand what is wrong. Here is my program:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="5.0.10" expanded="true" name="Process">
       <process expanded="true" height="341" width="433">
         <operator activated="true" class="generate_nominal_data" compatibility="5.0.10" expanded="true" height="60" name="Generate Nominal Data" width="90" x="45" y="30">
           <parameter key="number_of_attributes" value="20"/>
           <parameter key="number_of_values" value="2"/>
           <parameter key="use_local_random_seed" value="true"/>
           <parameter key="local_random_seed" value="2010"/>
         </operator>
         <operator activated="true" class="replace" compatibility="5.0.10" expanded="true" height="76" name="Replace" width="90" x="179" y="30">
           <parameter key="include_special_attributes" value="true"/>
           <parameter key="replace_what" value="value"/>
         </operator>
         <operator activated="true" class="series:windowing" compatibility="5.0.2" expanded="true" height="76" name="Windowing" width="90" x="313" y="30">
           <parameter key="window_size" value="41"/>
         </operator>
         <operator activated="true" class="subprocess" compatibility="5.0.10" expanded="true" height="76" name="SetMultiLabel" width="90" x="45" y="120">
           <parameter key="parallelize_nested_chain" value="true"/>
           <process expanded="true" height="701" width="433">
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel1" width="90" x="45" y="30">
               <parameter key="name" value="att1-0"/>
               <parameter key="target_role" value="label01"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel2" width="90" x="179" y="30">
               <parameter key="name" value="att2-0"/>
               <parameter key="target_role" value="label02"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel3" width="90" x="313" y="30">
               <parameter key="name" value="att3-0"/>
               <parameter key="target_role" value="label03"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel4" width="90" x="45" y="120">
               <parameter key="name" value="att4-0"/>
               <parameter key="target_role" value="label04"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel5" width="90" x="179" y="120">
               <parameter key="name" value="att5-0"/>
               <parameter key="target_role" value="label05"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel6" width="90" x="313" y="120">
               <parameter key="name" value="att6-0"/>
               <parameter key="target_role" value="label06"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel7" width="90" x="45" y="210">
               <parameter key="name" value="att7-0"/>
               <parameter key="target_role" value="label07"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel8" width="90" x="179" y="210">
               <parameter key="name" value="att8-0"/>
               <parameter key="target_role" value="label08"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel09" width="90" x="313" y="210">
               <parameter key="name" value="att9-0"/>
               <parameter key="target_role" value="label9"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel10" width="90" x="45" y="300">
               <parameter key="name" value="att10-0"/>
               <parameter key="target_role" value="label10"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel11" width="90" x="179" y="300">
               <parameter key="name" value="att11-0"/>
               <parameter key="target_role" value="label11"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel12" width="90" x="313" y="300">
               <parameter key="name" value="att12-0"/>
               <parameter key="target_role" value="label12"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel13" width="90" x="45" y="390">
               <parameter key="name" value="att13-0"/>
               <parameter key="target_role" value="label13"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel14" width="90" x="179" y="390">
               <parameter key="name" value="att14-0"/>
               <parameter key="target_role" value="label14"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel15" width="90" x="313" y="390">
               <parameter key="name" value="att15-0"/>
               <parameter key="target_role" value="label15"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel16" width="90" x="45" y="480">
               <parameter key="name" value="att16-0"/>
               <parameter key="target_role" value="label16"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel17" width="90" x="179" y="480">
               <parameter key="name" value="att17-0"/>
               <parameter key="target_role" value="label17"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel18" width="90" x="313" y="480">
               <parameter key="name" value="att18-0"/>
               <parameter key="target_role" value="label18"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel19" width="90" x="45" y="570">
               <parameter key="name" value="att19-0"/>
               <parameter key="target_role" value="label19"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel20" width="90" x="179" y="570">
               <parameter key="name" value="att20-0"/>
               <parameter key="target_role" value="label20"/>
             </operator>
             <connect from_port="in 1" to_op="SetLabel1" to_port="example set input"/>
             <connect from_op="SetLabel1" from_port="example set output" to_op="SetLabel2" to_port="example set input"/>
             <connect from_op="SetLabel2" from_port="example set output" to_op="SetLabel3" to_port="example set input"/>
             <connect from_op="SetLabel3" from_port="example set output" to_op="SetLabel4" to_port="example set input"/>
             <connect from_op="SetLabel4" from_port="example set output" to_op="SetLabel5" to_port="example set input"/>
             <connect from_op="SetLabel5" from_port="example set output" to_op="SetLabel6" to_port="example set input"/>
             <connect from_op="SetLabel6" from_port="example set output" to_op="SetLabel7" to_port="example set input"/>
             <connect from_op="SetLabel7" from_port="example set output" to_op="SetLabel8" to_port="example set input"/>
             <connect from_op="SetLabel8" from_port="example set output" to_op="SetLabel09" to_port="example set input"/>
             <connect from_op="SetLabel09" from_port="example set output" to_op="SetLabel10" to_port="example set input"/>
             <connect from_op="SetLabel10" from_port="example set output" to_op="SetLabel11" to_port="example set input"/>
             <connect from_op="SetLabel11" from_port="example set output" to_op="SetLabel12" to_port="example set input"/>
             <connect from_op="SetLabel12" from_port="example set output" to_op="SetLabel13" to_port="example set input"/>
             <connect from_op="SetLabel13" from_port="example set output" to_op="SetLabel14" to_port="example set input"/>
             <connect from_op="SetLabel14" from_port="example set output" to_op="SetLabel15" to_port="example set input"/>
             <connect from_op="SetLabel15" from_port="example set output" to_op="SetLabel16" to_port="example set input"/>
             <connect from_op="SetLabel16" from_port="example set output" to_op="SetLabel17" to_port="example set input"/>
             <connect from_op="SetLabel17" from_port="example set output" to_op="SetLabel18" to_port="example set input"/>
             <connect from_op="SetLabel18" from_port="example set output" to_op="SetLabel19" to_port="example set input"/>
             <connect from_op="SetLabel19" from_port="example set output" to_op="SetLabel20" to_port="example set input"/>
             <connect from_op="SetLabel20" from_port="example set output" to_port="out 1"/>
             <portSpacing port="source_in 1" spacing="0"/>
             <portSpacing port="source_in 2" spacing="0"/>
             <portSpacing port="sink_out 1" spacing="540"/>
             <portSpacing port="sink_out 2" spacing="0"/>
           </process>
         </operator>
         <operator activated="true" class="loop_labels" compatibility="5.0.10" expanded="true" height="76" name="MultipleLabelIterator" width="90" x="179" y="120">
           <parameter key="parallelize_iteration" value="true"/>
           <process expanded="true" height="322" width="165">
             <operator activated="true" class="x_validation" compatibility="5.0.10" expanded="true" height="112" name="Validation" width="90" x="45" y="30">
               <parameter key="parallelize_training" value="true"/>
               <process expanded="true" height="322" width="165">
                 <operator activated="true" class="k_nn" compatibility="5.0.10" expanded="true" height="76" name="k-NN" width="90" x="45" y="30">
                   <parameter key="k" value="3"/>
                   <parameter key="weighted_vote" value="true"/>
                   <parameter key="measure_types" value="NominalMeasures"/>
                 </operator>
                 <connect from_port="training" to_op="k-NN" to_port="training set"/>
                 <connect from_op="k-NN" from_port="model" to_port="model"/>
                 <portSpacing port="source_training" spacing="0"/>
                 <portSpacing port="sink_model" spacing="0"/>
                 <portSpacing port="sink_through 1" spacing="0"/>
               </process>
               <process expanded="true" height="322" width="433">
                 <operator activated="true" class="apply_model" compatibility="5.0.10" expanded="true" height="76" name="Apply Model" width="90" x="45" y="30">
                   <list key="application_parameters"/>
                 </operator>
                 <operator activated="true" class="apply_model" compatibility="5.0.11" expanded="true" height="76" name="Apply Model (2)" width="90" x="180" y="30">
                   <list key="application_parameters"/>
                 </operator>
                 <operator activated="true" class="find_threshold" compatibility="5.0.10" expanded="true" height="76" name="Find Threshold" width="90" x="45" y="120"/>
                 <operator activated="true" class="apply_threshold" compatibility="5.0.10" expanded="true" height="76" name="Apply Threshold" width="90" x="179" y="120"/>
                 <operator activated="true" class="performance_binominal_classification" compatibility="5.0.10" expanded="true" height="76" name="Performance" width="90" x="313" y="120"/>
                 <connect from_port="model" to_op="Apply Model" to_port="model"/>
                 <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
                 <connect from_op="Apply Model" from_port="labelled data" to_op="Apply Model (2)" to_port="unlabelled data"/>
                 <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Find Threshold" to_port="example set"/>
                 <connect from_op="Find Threshold" from_port="example set" to_op="Apply Threshold" to_port="example set"/>
                 <connect from_op="Find Threshold" from_port="threshold" to_op="Apply Threshold" to_port="threshold"/>
                 <connect from_op="Apply Threshold" from_port="example set" to_op="Performance" to_port="labelled data"/>
                 <connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
                 <portSpacing port="source_model" spacing="0"/>
                 <portSpacing port="source_test set" spacing="0"/>
                 <portSpacing port="source_through 1" spacing="0"/>
                 <portSpacing port="sink_averagable 1" spacing="90"/>
                 <portSpacing port="sink_averagable 2" spacing="36"/>
               </process>
             </operator>
             <connect from_port="example set" to_op="Validation" to_port="training"/>
             <connect from_op="Validation" from_port="averagable 1" to_port="out 1"/>
             <portSpacing port="source_example set" spacing="0"/>
             <portSpacing port="sink_out 1" spacing="36"/>
             <portSpacing port="sink_out 2" spacing="90"/>
           </process>
         </operator>
         <connect from_op="Generate Nominal Data" from_port="output" to_op="Replace" to_port="example set input"/>
         <connect from_op="Replace" from_port="example set output" to_op="Windowing" to_port="example set input"/>
         <connect from_op="Windowing" from_port="example set output" to_op="SetMultiLabel" to_port="in 1"/>
         <connect from_op="SetMultiLabel" from_port="out 1" to_op="MultipleLabelIterator" to_port="example set"/>
         <connect from_op="MultipleLabelIterator" from_port="out 1" to_port="result 1"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="sink_result 1" spacing="90"/>
         <portSpacing port="sink_result 2" spacing="72"/>
       </process>
     </operator>
    </process>
    Could you help me?
    Winkad
  • Options
    SebastianLohSebastianLoh Member Posts: 99 Contributor II
    Hi WinKad,

    maybe this example helps. You could also use a proper regular expression in the loop attributes operator. However this one you need to find on your own ;-)
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.0.10" expanded="true" name="Process">
        <process expanded="true" height="370" width="480">
          <operator activated="true" class="generate_nominal_data" compatibility="5.0.10" expanded="true" height="60" name="Generate Nominal Data" width="90" x="45" y="30">
            <parameter key="number_of_attributes" value="20"/>
            <parameter key="number_of_values" value="2"/>
            <parameter key="use_local_random_seed" value="true"/>
            <parameter key="local_random_seed" value="2010"/>
          </operator>
          <operator activated="true" class="replace" compatibility="5.0.10" expanded="true" height="76" name="Replace" width="90" x="179" y="30">
            <parameter key="include_special_attributes" value="true"/>
            <parameter key="replace_what" value="value"/>
          </operator>
          <operator activated="true" breakpoints="after" class="series:windowing" compatibility="5.0.2" expanded="true" height="76" name="Windowing" width="90" x="313" y="30">
            <parameter key="window_size" value="41"/>
          </operator>
          <operator activated="true" class="multiply" compatibility="5.0.10" expanded="true" height="94" name="Multiply" width="90" x="45" y="120"/>
          <operator activated="true" breakpoints="after" class="loop_attributes" compatibility="5.0.10" expanded="true" height="60" name="Loop Attributes" width="90" x="246" y="300">
            <parameter key="attribute_filter_type" value="subset"/>
            <parameter key="attributes" value="att11-0|att10-0|att1-0"/>
            <process expanded="true" height="453" width="674">
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="Set Role" width="90" x="112" y="30">
                <parameter key="name" value="%{loop_attribute}"/>
                <parameter key="target_role" value="label-%{a}"/>
              </operator>
              <operator activated="false" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="Set Role (2)" width="90" x="112" y="120">
                <parameter key="name" value="%{loop_attribute}"/>
                <parameter key="target_role" value="label-%{loop_attribute}"/>
              </operator>
              <connect from_port="example set" to_op="Set Role" to_port="example set input"/>
              <connect from_op="Set Role" from_port="example set output" to_port="example set"/>
              <portSpacing port="source_example set" spacing="0"/>
              <portSpacing port="sink_example set" spacing="0"/>
            </process>
          </operator>
          <operator activated="true" class="subprocess" compatibility="5.0.10" expanded="true" height="76" name="SetMultiLabel" width="90" x="246" y="165">
            <parameter key="parallelize_nested_chain" value="true"/>
            <process expanded="true" height="701" width="433">
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel1" width="90" x="45" y="30">
                <parameter key="name" value="att1-0"/>
                <parameter key="target_role" value="label01"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel2" width="90" x="179" y="30">
                <parameter key="name" value="att2-0"/>
                <parameter key="target_role" value="label02"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel3" width="90" x="313" y="30">
                <parameter key="name" value="att3-0"/>
                <parameter key="target_role" value="label03"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel4" width="90" x="45" y="120">
                <parameter key="name" value="att4-0"/>
                <parameter key="target_role" value="label04"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel5" width="90" x="179" y="120">
                <parameter key="name" value="att5-0"/>
                <parameter key="target_role" value="label05"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel6" width="90" x="313" y="120">
                <parameter key="name" value="att6-0"/>
                <parameter key="target_role" value="label06"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel7" width="90" x="45" y="210">
                <parameter key="name" value="att7-0"/>
                <parameter key="target_role" value="label07"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel8" width="90" x="179" y="210">
                <parameter key="name" value="att8-0"/>
                <parameter key="target_role" value="label08"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel09" width="90" x="313" y="210">
                <parameter key="name" value="att9-0"/>
                <parameter key="target_role" value="label9"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel10" width="90" x="45" y="300">
                <parameter key="name" value="att10-0"/>
                <parameter key="target_role" value="label10"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel11" width="90" x="179" y="300">
                <parameter key="name" value="att11-0"/>
                <parameter key="target_role" value="label11"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel12" width="90" x="313" y="300">
                <parameter key="name" value="att12-0"/>
                <parameter key="target_role" value="label12"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel13" width="90" x="45" y="390">
                <parameter key="name" value="att13-0"/>
                <parameter key="target_role" value="label13"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel14" width="90" x="179" y="390">
                <parameter key="name" value="att14-0"/>
                <parameter key="target_role" value="label14"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel15" width="90" x="313" y="390">
                <parameter key="name" value="att15-0"/>
                <parameter key="target_role" value="label15"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel16" width="90" x="45" y="480">
                <parameter key="name" value="att16-0"/>
                <parameter key="target_role" value="label16"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel17" width="90" x="179" y="480">
                <parameter key="name" value="att17-0"/>
                <parameter key="target_role" value="label17"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel18" width="90" x="313" y="480">
                <parameter key="name" value="att18-0"/>
                <parameter key="target_role" value="label18"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel19" width="90" x="45" y="570">
                <parameter key="name" value="att19-0"/>
                <parameter key="target_role" value="label19"/>
              </operator>
              <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel20" width="90" x="179" y="570">
                <parameter key="name" value="att20-0"/>
                <parameter key="target_role" value="label20"/>
              </operator>
              <connect from_port="in 1" to_op="SetLabel1" to_port="example set input"/>
              <connect from_op="SetLabel1" from_port="example set output" to_op="SetLabel2" to_port="example set input"/>
              <connect from_op="SetLabel2" from_port="example set output" to_op="SetLabel3" to_port="example set input"/>
              <connect from_op="SetLabel3" from_port="example set output" to_op="SetLabel4" to_port="example set input"/>
              <connect from_op="SetLabel4" from_port="example set output" to_op="SetLabel5" to_port="example set input"/>
              <connect from_op="SetLabel5" from_port="example set output" to_op="SetLabel6" to_port="example set input"/>
              <connect from_op="SetLabel6" from_port="example set output" to_op="SetLabel7" to_port="example set input"/>
              <connect from_op="SetLabel7" from_port="example set output" to_op="SetLabel8" to_port="example set input"/>
              <connect from_op="SetLabel8" from_port="example set output" to_op="SetLabel09" to_port="example set input"/>
              <connect from_op="SetLabel09" from_port="example set output" to_op="SetLabel10" to_port="example set input"/>
              <connect from_op="SetLabel10" from_port="example set output" to_op="SetLabel11" to_port="example set input"/>
              <connect from_op="SetLabel11" from_port="example set output" to_op="SetLabel12" to_port="example set input"/>
              <connect from_op="SetLabel12" from_port="example set output" to_op="SetLabel13" to_port="example set input"/>
              <connect from_op="SetLabel13" from_port="example set output" to_op="SetLabel14" to_port="example set input"/>
              <connect from_op="SetLabel14" from_port="example set output" to_op="SetLabel15" to_port="example set input"/>
              <connect from_op="SetLabel15" from_port="example set output" to_op="SetLabel16" to_port="example set input"/>
              <connect from_op="SetLabel16" from_port="example set output" to_op="SetLabel17" to_port="example set input"/>
              <connect from_op="SetLabel17" from_port="example set output" to_op="SetLabel18" to_port="example set input"/>
              <connect from_op="SetLabel18" from_port="example set output" to_op="SetLabel19" to_port="example set input"/>
              <connect from_op="SetLabel19" from_port="example set output" to_op="SetLabel20" to_port="example set input"/>
              <connect from_op="SetLabel20" from_port="example set output" to_port="out 1"/>
              <portSpacing port="source_in 1" spacing="0"/>
              <portSpacing port="source_in 2" spacing="0"/>
              <portSpacing port="sink_out 1" spacing="540"/>
              <portSpacing port="sink_out 2" spacing="0"/>
            </process>
          </operator>
          <operator activated="true" class="loop_labels" compatibility="5.0.10" expanded="true" height="76" name="MultipleLabelIterator" width="90" x="380" y="120">
            <parameter key="parallelize_iteration" value="true"/>
            <process expanded="true" height="322" width="165">
              <operator activated="true" class="x_validation" compatibility="5.0.10" expanded="true" height="112" name="Validation" width="90" x="45" y="30">
                <parameter key="parallelize_training" value="true"/>
                <process expanded="true" height="322" width="165">
                  <operator activated="true" class="k_nn" compatibility="5.0.10" expanded="true" height="76" name="k-NN" width="90" x="45" y="30">
                    <parameter key="k" value="3"/>
                    <parameter key="weighted_vote" value="true"/>
                    <parameter key="measure_types" value="NominalMeasures"/>
                  </operator>
                  <connect from_port="training" to_op="k-NN" to_port="training set"/>
                  <connect from_op="k-NN" from_port="model" to_port="model"/>
                  <portSpacing port="source_training" spacing="0"/>
                  <portSpacing port="sink_model" spacing="0"/>
                  <portSpacing port="sink_through 1" spacing="0"/>
                </process>
                <process expanded="true" height="322" width="433">
                  <operator activated="true" class="apply_model" compatibility="5.0.10" expanded="true" height="76" name="Apply Model" width="90" x="45" y="30">
                    <list key="application_parameters"/>
                  </operator>
                  <operator activated="true" class="apply_model" compatibility="5.0.11" expanded="true" height="76" name="Apply Model (2)" width="90" x="180" y="30">
                    <list key="application_parameters"/>
                  </operator>
                  <operator activated="true" class="find_threshold" compatibility="5.0.10" expanded="true" height="76" name="Find Threshold" width="90" x="45" y="120"/>
                  <operator activated="true" class="apply_threshold" compatibility="5.0.10" expanded="true" height="76" name="Apply Threshold" width="90" x="179" y="120"/>
                  <operator activated="true" class="performance_binominal_classification" compatibility="5.0.10" expanded="true" height="76" name="Performance" width="90" x="313" y="120"/>
                  <connect from_port="model" to_op="Apply Model" to_port="model"/>
                  <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
                  <connect from_op="Apply Model" from_port="labelled data" to_op="Apply Model (2)" to_port="unlabelled data"/>
                  <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Find Threshold" to_port="example set"/>
                  <connect from_op="Find Threshold" from_port="example set" to_op="Apply Threshold" to_port="example set"/>
                  <connect from_op="Find Threshold" from_port="threshold" to_op="Apply Threshold" to_port="threshold"/>
                  <connect from_op="Apply Threshold" from_port="example set" to_op="Performance" to_port="labelled data"/>
                  <connect from_op="Performance" from_port="performance" to_port="averagable 1"/>
                  <portSpacing port="source_model" spacing="0"/>
                  <portSpacing port="source_test set" spacing="0"/>
                  <portSpacing port="source_through 1" spacing="0"/>
                  <portSpacing port="sink_averagable 1" spacing="90"/>
                  <portSpacing port="sink_averagable 2" spacing="36"/>
                </process>
              </operator>
              <connect from_port="example set" to_op="Validation" to_port="training"/>
              <connect from_op="Validation" from_port="averagable 1" to_port="out 1"/>
              <portSpacing port="source_example set" spacing="0"/>
              <portSpacing port="sink_out 1" spacing="36"/>
              <portSpacing port="sink_out 2" spacing="90"/>
            </process>
          </operator>
          <connect from_op="Generate Nominal Data" from_port="output" to_op="Replace" to_port="example set input"/>
          <connect from_op="Replace" from_port="example set output" to_op="Windowing" to_port="example set input"/>
          <connect from_op="Windowing" from_port="example set output" to_op="Multiply" to_port="input"/>
          <connect from_op="Multiply" from_port="output 1" to_op="SetMultiLabel" to_port="in 1"/>
          <connect from_op="Multiply" from_port="output 2" to_op="Loop Attributes" to_port="example set"/>
          <connect from_op="Loop Attributes" from_port="example set" to_port="result 2"/>
          <connect from_op="SetMultiLabel" from_port="out 1" to_op="MultipleLabelIterator" to_port="example set"/>
          <connect from_op="MultipleLabelIterator" from_port="out 1" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="90"/>
          <portSpacing port="sink_result 2" spacing="72"/>
          <portSpacing port="sink_result 3" spacing="0"/>
        </process>
      </operator>
    </process>
    Since you have very specific questions which need to much time to provide a comprehensive answer, you might be interessted in a RapidMiner support subscription. Please let me know if you would like to get further information about our support services.

    Ciao Sebastian
  • Options
    WinKadWinKad Member Posts: 9 Contributor II
    Hi Sebastian,
    thank you for reply.
    To close this topic I add the following which aswered my question from the beginning:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.0">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="5.0.10" expanded="true" name="Process">
       <process expanded="true" height="325" width="433">
         <operator activated="true" class="generate_nominal_data" compatibility="5.0.10" expanded="true" height="60" name="Generate Nominal Data" width="90" x="45" y="30">
           <parameter key="number_of_attributes" value="20"/>
           <parameter key="number_of_values" value="2"/>
           <parameter key="use_local_random_seed" value="true"/>
           <parameter key="local_random_seed" value="2010"/>
         </operator>
         <operator activated="true" class="replace" compatibility="5.0.10" expanded="true" height="76" name="Replace" width="90" x="179" y="30">
           <parameter key="include_special_attributes" value="true"/>
           <parameter key="replace_what" value="value"/>
         </operator>
         <operator activated="true" class="series:windowing" compatibility="5.0.2" expanded="true" height="76" name="Windowing" width="90" x="313" y="30">
           <parameter key="window_size" value="41"/>
         </operator>
         <operator activated="true" class="multiply" compatibility="5.0.11" expanded="true" height="94" name="Multiply" width="90" x="45" y="120"/>
         <operator activated="true" class="loop_attributes" compatibility="5.0.11" expanded="true" height="60" name="Loop Attributes" width="90" x="179" y="210">
           <parameter key="attribute_filter_type" value="regular_expression"/>
           <parameter key="attributes" value="att1-0|att10-0|att11-0|att12-0|att13-0|att14-0|att15-0|att16-0|att17-0|att18-0|att19-0|att2-0|att20-0|att3-0|att4-0|att5-0|att6-0|att7-0|att8-0|att9-0"/>
           <parameter key="regular_expression" value="att.-0|att..-0"/>
           <process expanded="true" height="340" width="165">
             <operator activated="true" class="set_role" compatibility="5.0.11" expanded="true" height="76" name="Set Role" width="90" x="45" y="30">
               <parameter key="name" value="%{loop_attribute}"/>
               <parameter key="target_role" value="label%{a}"/>
             </operator>
             <connect from_port="example set" to_op="Set Role" to_port="example set input"/>
             <connect from_op="Set Role" from_port="example set output" to_port="example set"/>
             <portSpacing port="source_example set" spacing="0"/>
             <portSpacing port="sink_example set" spacing="0"/>
           </process>
         </operator>
         <operator activated="true" class="subprocess" compatibility="5.0.10" expanded="true" height="76" name="SetMultiLabel" width="90" x="179" y="120">
           <parameter key="parallelize_nested_chain" value="true"/>
           <process expanded="true" height="701" width="433">
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel1" width="90" x="45" y="30">
               <parameter key="name" value="att1-0"/>
               <parameter key="target_role" value="label01"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel2" width="90" x="179" y="30">
               <parameter key="name" value="att2-0"/>
               <parameter key="target_role" value="label02"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel3" width="90" x="313" y="30">
               <parameter key="name" value="att3-0"/>
               <parameter key="target_role" value="label03"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel4" width="90" x="45" y="120">
               <parameter key="name" value="att4-0"/>
               <parameter key="target_role" value="label04"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel5" width="90" x="179" y="120">
               <parameter key="name" value="att5-0"/>
               <parameter key="target_role" value="label05"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel6" width="90" x="313" y="120">
               <parameter key="name" value="att6-0"/>
               <parameter key="target_role" value="label06"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel7" width="90" x="45" y="210">
               <parameter key="name" value="att7-0"/>
               <parameter key="target_role" value="label07"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel8" width="90" x="179" y="210">
               <parameter key="name" value="att8-0"/>
               <parameter key="target_role" value="label08"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel09" width="90" x="313" y="210">
               <parameter key="name" value="att9-0"/>
               <parameter key="target_role" value="label9"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel10" width="90" x="45" y="300">
               <parameter key="name" value="att10-0"/>
               <parameter key="target_role" value="label10"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel11" width="90" x="179" y="300">
               <parameter key="name" value="att11-0"/>
               <parameter key="target_role" value="label11"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel12" width="90" x="313" y="300">
               <parameter key="name" value="att12-0"/>
               <parameter key="target_role" value="label12"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel13" width="90" x="45" y="390">
               <parameter key="name" value="att13-0"/>
               <parameter key="target_role" value="label13"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel14" width="90" x="179" y="390">
               <parameter key="name" value="att14-0"/>
               <parameter key="target_role" value="label14"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel15" width="90" x="313" y="390">
               <parameter key="name" value="att15-0"/>
               <parameter key="target_role" value="label15"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel16" width="90" x="45" y="480">
               <parameter key="name" value="att16-0"/>
               <parameter key="target_role" value="label16"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel17" width="90" x="179" y="480">
               <parameter key="name" value="att17-0"/>
               <parameter key="target_role" value="label17"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel18" width="90" x="313" y="480">
               <parameter key="name" value="att18-0"/>
               <parameter key="target_role" value="label18"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel19" width="90" x="45" y="570">
               <parameter key="name" value="att19-0"/>
               <parameter key="target_role" value="label19"/>
             </operator>
             <operator activated="true" class="set_role" compatibility="5.0.10" expanded="true" height="76" name="SetLabel20" width="90" x="179" y="570">
               <parameter key="name" value="att20-0"/>
               <parameter key="target_role" value="label20"/>
             </operator>
             <connect from_port="in 1" to_op="SetLabel1" to_port="example set input"/>
             <connect from_op="SetLabel1" from_port="example set output" to_op="SetLabel2" to_port="example set input"/>
             <connect from_op="SetLabel2" from_port="example set output" to_op="SetLabel3" to_port="example set input"/>
             <connect from_op="SetLabel3" from_port="example set output" to_op="SetLabel4" to_port="example set input"/>
             <connect from_op="SetLabel4" from_port="example set output" to_op="SetLabel5" to_port="example set input"/>
             <connect from_op="SetLabel5" from_port="example set output" to_op="SetLabel6" to_port="example set input"/>
             <connect from_op="SetLabel6" from_port="example set output" to_op="SetLabel7" to_port="example set input"/>
             <connect from_op="SetLabel7" from_port="example set output" to_op="SetLabel8" to_port="example set input"/>
             <connect from_op="SetLabel8" from_port="example set output" to_op="SetLabel09" to_port="example set input"/>
             <connect from_op="SetLabel09" from_port="example set output" to_op="SetLabel10" to_port="example set input"/>
             <connect from_op="SetLabel10" from_port="example set output" to_op="SetLabel11" to_port="example set input"/>
             <connect from_op="SetLabel11" from_port="example set output" to_op="SetLabel12" to_port="example set input"/>
             <connect from_op="SetLabel12" from_port="example set output" to_op="SetLabel13" to_port="example set input"/>
             <connect from_op="SetLabel13" from_port="example set output" to_op="SetLabel14" to_port="example set input"/>
             <connect from_op="SetLabel14" from_port="example set output" to_op="SetLabel15" to_port="example set input"/>
             <connect from_op="SetLabel15" from_port="example set output" to_op="SetLabel16" to_port="example set input"/>
             <connect from_op="SetLabel16" from_port="example set output" to_op="SetLabel17" to_port="example set input"/>
             <connect from_op="SetLabel17" from_port="example set output" to_op="SetLabel18" to_port="example set input"/>
             <connect from_op="SetLabel18" from_port="example set output" to_op="SetLabel19" to_port="example set input"/>
             <connect from_op="SetLabel19" from_port="example set output" to_op="SetLabel20" to_port="example set input"/>
             <connect from_op="SetLabel20" from_port="example set output" to_port="out 1"/>
             <portSpacing port="source_in 1" spacing="0"/>
             <portSpacing port="source_in 2" spacing="0"/>
             <portSpacing port="sink_out 1" spacing="540"/>
             <portSpacing port="sink_out 2" spacing="0"/>
           </process>
         </operator>
         <connect from_op="Generate Nominal Data" from_port="output" to_op="Replace" to_port="example set input"/>
         <connect from_op="Replace" from_port="example set output" to_op="Windowing" to_port="example set input"/>
         <connect from_op="Windowing" from_port="example set output" to_op="Multiply" to_port="input"/>
         <connect from_op="Multiply" from_port="output 1" to_op="SetMultiLabel" to_port="in 1"/>
         <connect from_op="Multiply" from_port="output 2" to_op="Loop Attributes" to_port="example set"/>
         <connect from_op="Loop Attributes" from_port="example set" to_port="result 2"/>
         <connect from_op="SetMultiLabel" from_port="out 1" to_port="result 1"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="sink_result 1" spacing="90"/>
         <portSpacing port="sink_result 2" spacing="0"/>
         <portSpacing port="sink_result 3" spacing="0"/>
       </process>
     </operator>
    </process>
    The key is "att.*|att..*" in connection with Set Role with  %{loop_attribute} under name and label%[a} under target.

    I am a lonely fighter and have the ambition, to find out much for myself. Once more thanks.
    Winkad
  • Options
    SebastianLohSebastianLoh Member Posts: 99 Contributor II
    Hi WinKad,

    thanks for sharing your solution!

    Bye Sebastian

    P.s try the "[code ] ... [/code ]" environment for program code
Sign In or Register to comment.