[Solved] Shift all examples in an attribute by one
Dear all,
I'm looking for a way to create a copy of the attributes which is shifted by one example compared to the original.
Original:
att1 att2
10 50
20 100
30 150
Expexted result:
att1 att1_shifted att2 att2_shifted
10 20 50 100
20 30 100 150
30 150
I tried with the "loop" and "macro" operators but until now I found no solution for this.
I'm always struggiling with these two parameters
Cheers
Sachs
I'm looking for a way to create a copy of the attributes which is shifted by one example compared to the original.
Original:
att1 att2
10 50
20 100
30 150
Expexted result:
att1 att1_shifted att2 att2_shifted
10 20 50 100
20 30 100 150
30 150
I tried with the "loop" and "macro" operators but until now I found no solution for this.
I'm always struggiling with these two parameters

Cheers
Sachs
Find more posts tagged with
Sort by:
1 - 3 of
31
Hey, you can do it with one single operator: try Windowing from the Series extension.
Best,
Marius
Best,
Marius
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.009">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.009" expanded="true" name="Process">
<process expanded="true" height="534" width="580">
<operator activated="true" class="generate_nominal_data" compatibility="5.2.009" expanded="true" height="60" name="Generate Nominal Data" width="90" x="45" y="30">
<parameter key="number_of_attributes" value="1"/>
</operator>
<operator activated="true" class="series:windowing" compatibility="5.2.000" expanded="true" height="76" name="Windowing" width="90" x="179" y="30">
<parameter key="window_size" value="2"/>
</operator>
<connect from_op="Generate Nominal Data" from_port="output" to_op="Windowing" to_port="example set input"/>
<connect from_op="Windowing" from_port="example set output" 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>
Ok, here is what I found out so far. Not quite yet what I was looking for but maybe this could be an inspiration for all the brains out there...
Best regards
Sachs