"[Solved] Combining collection after windowing"

qwertzqwertz Member Posts: 130 Contributor II
edited June 2019 in Help
Dear all,

Being quite optimistic after my last problem has been solved I started to expand my process facing another setback when discovering new problems of which I think that they are kind of bugs:
Missing id attribute after Windowing operator http://rapid-i.com/rapidforum/index.php/topic,5214.0.html
Error in Generate Attributes operator http://rapid-i.com/rapidforum/index.php/topic,5213.0.html

Anyway, I hope that there's anyone out there who might be able to help with a workaround. As a result of the process I would like to have a single table with one ID attribute and all the prediction attributes created by windowing in each loop.


I have attached the code I tried to use with the shortcomings in the "generate attributes" and "select attributes" operator mentioned before.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.006">
 <context>
   <input/>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.2.006" expanded="true" name="Process">
   <process expanded="true" height="353" width="949">
     <operator activated="true" class="generate_data" compatibility="5.2.006" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30"/>
     <operator activated="true" class="select_attributes" compatibility="5.2.006" expanded="true" height="76" name="Select Attributes" width="90" x="179" y="30">
       <parameter key="attribute_filter_type" value="single"/>
       <parameter key="attribute" value="label"/>
       <parameter key="invert_selection" value="true"/>
       <parameter key="include_special_attributes" value="true"/>
     </operator>
     <operator activated="true" class="generate_id" compatibility="5.2.006" expanded="true" height="76" name="Generate ID" width="90" x="313" y="30"/>
     <operator activated="true" class="multiply" compatibility="5.2.006" expanded="true" height="94" name="Multiply" width="90" x="447" y="30"/>
     <operator activated="true" class="loop_parameters" compatibility="5.2.006" expanded="true" height="94" name="Loop Parameters" width="90" x="313" y="165">
       <list key="parameters">
         <parameter key="Windowing.label_attribute" value="att1,att2"/>
       </list>
       <process expanded="true" height="353" width="614">
         <operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing (2)" width="90" x="45" y="165">
           <parameter key="window_size" value="1"/>
         </operator>
         <operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing" width="90" x="45" y="30">
           <parameter key="horizon" value="1"/>
           <parameter key="window_size" value="1"/>
           <parameter key="create_label" value="true"/>
           <parameter key="label_attribute" value="att2"/>
         </operator>
         <operator activated="true" class="series:sliding_window_validation" compatibility="5.1.002" expanded="true" height="112" name="Validation" width="90" x="179" y="30">
           <parameter key="training_window_width" value="20"/>
           <parameter key="training_window_step_size" value="5"/>
           <parameter key="test_window_width" value="20"/>
           <parameter key="horizon" value="5"/>
           <process expanded="true" height="371" width="321">
             <operator activated="true" class="support_vector_machine" compatibility="5.2.006" expanded="true" height="112" name="SVM" width="90" x="115" y="30"/>
             <connect from_port="training" to_op="SVM" to_port="training set"/>
             <connect from_op="SVM" 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="371" width="321">
             <operator activated="true" class="apply_model" compatibility="5.2.006" expanded="true" height="76" name="Apply Model" width="90" x="45" y="30">
               <list key="application_parameters"/>
             </operator>
             <operator activated="true" class="series:forecasting_performance" compatibility="5.1.002" expanded="true" height="76" name="Performance" width="90" x="183" y="30">
               <parameter key="horizon" value="1"/>
             </operator>
             <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="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="0"/>
             <portSpacing port="sink_averagable 2" spacing="0"/>
           </process>
         </operator>
         <operator activated="true" class="apply_model" compatibility="5.2.006" expanded="true" height="76" name="Apply Model (2)" width="90" x="313" y="120">
           <list key="application_parameters"/>
         </operator>
         <operator activated="true" class="generate_attributes" compatibility="5.2.006" expanded="true" height="76" name="Generate Attributes" width="90" x="447" y="120">
           <list key="function_descriptions">
             <parameter key="NEW" value="param(&quot;Windowing&quot;, &quot;label attribute&quot;)"/>
           </list>
         </operator>
         <connect from_port="input 1" to_op="Windowing" to_port="example set input"/>
         <connect from_port="input 2" to_op="Windowing (2)" to_port="example set input"/>
         <connect from_op="Windowing (2)" from_port="example set output" to_op="Apply Model (2)" to_port="unlabelled data"/>
         <connect from_op="Windowing" from_port="example set output" to_op="Validation" to_port="training"/>
         <connect from_op="Validation" from_port="model" to_op="Apply Model (2)" to_port="model"/>
         <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Generate Attributes" to_port="example set input"/>
         <connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="source_input 2" spacing="0"/>
         <portSpacing port="source_input 3" spacing="0"/>
         <portSpacing port="sink_performance" spacing="72"/>
         <portSpacing port="sink_result 1" spacing="0"/>
         <portSpacing port="sink_result 2" spacing="0"/>
       </process>
     </operator>
     <operator activated="true" class="append" compatibility="5.2.006" expanded="true" height="76" name="Append" width="90" x="447" y="165"/>
     <operator activated="true" class="select_attributes" compatibility="5.2.006" expanded="true" height="76" name="Select Attributes" width="90" x="581" y="165">
       <parameter key="attribute_filter_type" value="subset"/>
       <parameter key="attributes" value="|prediction(label)|NEW"/>
     </operator>
     <operator activated="true" class="pivot" compatibility="5.2.006" expanded="true" height="76" name="Pivot" width="90" x="715" y="165">
       <parameter key="group_attribute" value="NEW"/>
       <parameter key="index_attribute" value="prediction(label)"/>
     </operator>
     <connect from_op="Generate Data" from_port="output" to_op="Select Attributes" to_port="example set input"/>
     <connect from_op="Select Attributes" from_port="example set output" to_op="Generate ID" to_port="example set input"/>
     <connect from_op="Generate ID" from_port="example set output" to_op="Multiply" to_port="input"/>
     <connect from_op="Multiply" from_port="output 1" to_op="Loop Parameters" to_port="input 1"/>
     <connect from_op="Multiply" from_port="output 2" to_op="Loop Parameters" to_port="input 2"/>
     <connect from_op="Loop Parameters" from_port="result 1" to_op="Append" to_port="example set 1"/>
     <connect from_op="Append" from_port="merged set" to_op="Select Attributes" to_port="example set input"/>
     <connect from_op="Select Attributes" from_port="example set output" to_op="Pivot" to_port="example set input"/>
     <connect from_op="Pivot" from_port="example set output" to_port="result 1"/>
     <portSpacing port="source_input 1" spacing="0"/>
     <portSpacing port="sink_result 1" spacing="126"/>
     <portSpacing port="sink_result 2" spacing="18"/>
   </process>
 </operator>
</process>

Best regards
Sachs
Tagged:

Answers

  • qwertzqwertz Member Posts: 130 Contributor II

    Ok, this seems to be solved now (see linked threads)  ;D
Sign In or Register to comment.