Pages: [1]
  Print  
Author Topic: reference for previous value of an attribute  (Read 564 times)
robben
Newbie
*
Posts: 9


« on: July 13, 2013, 09:33:41 PM »

Hi all,
i have an attribute att1 and i want to build newatt by generate attribute's function expression that is the difference between the actual value of att1 and the value of att1 of the previous example (row). How can i reference the value of att1 of the previous example?
Thanks for the help
Logged
awchisholm
Sr. Member
****
Posts: 369


WWW
« Reply #1 on: July 13, 2013, 09:49:11 PM »

Hello

The Differentiate operator in the value series extension might give you something to start with

regards

Andrew
Logged

robben
Newbie
*
Posts: 9


« Reply #2 on: July 15, 2013, 07:21:49 AM »

Thanks Andrew,
i have to use in the formula attributes of the same example but from differents time series?
for example i have to calculate a percent variation between more than one attribute of the preview or following rows?
To explain, In excel being in row number 2 to on the column c (C2) i should calcutate something like = (A1-B1)/B1*100
How to implement it in Rapidminer (using pure RM or by Series Extension)?
Is there any user manual of series extensions?
Logged
awchisholm
Sr. Member
****
Posts: 369


WWW
« Reply #3 on: July 15, 2013, 08:11:15 AM »

Hello Robben

I get it - you could try the Lag Series operator. Here's an example

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="generate_data" compatibility="5.3.008" expanded="true" height="60" name="Generate Data" width="90" x="45" y="30">
        <parameter key="number_of_attributes" value="3"/>
      </operator>
      <operator activated="true" class="generate_attributes" compatibility="5.3.008" expanded="true" height="76" name="Generate Attributes" width="90" x="179" y="30">
        <list key="function_descriptions">
          <parameter key="newAtt" value="(att1-att2)/(att3*100)"/>
        </list>
      </operator>
      <operator activated="true" class="series:lag_series" compatibility="5.3.000" expanded="true" height="76" name="Lag Series" width="90" x="313" y="30">
        <list key="attributes">
          <parameter key="newAtt" value="1"/>
        </list>
      </operator>
      <connect from_op="Generate Data" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
      <connect from_op="Generate Attributes" from_port="example set output" to_op="Lag Series" to_port="example set input"/>
      <connect from_op="Lag Series" from_port="example set output" to_port="result 1"/>
      <connect from_op="Lag Series" from_port="original" to_port="result 2"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
    </process>
  </operator>
</process>

regards

Andrew
Logged

robben
Newbie
*
Posts: 9


« Reply #4 on: July 22, 2013, 01:20:32 PM »

Hi Andrew,
thanks a lot. I will check your solution
Roberto

Logged
Pages: [1]
  Print  
 
Jump to: