Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
Cumulative average
vinothrajan
Member Posts: 3 Contributor I
Hi ..
Need to calculate cumulative average,able to do cumulative sum. But want to calculate cumulative average like below
C1 C2 C3
1 1 1
2 3 1.5
3 6 2
here C1 - real value,c2 cumulative sum,c3 cumulative average-which need to calculate.
thanks in advance.
Need to calculate cumulative average,able to do cumulative sum. But want to calculate cumulative average like below
C1 C2 C3
1 1 1
2 3 1.5
3 6 2
here C1 - real value,c2 cumulative sum,c3 cumulative average-which need to calculate.
thanks in advance.
0
Answers
Hi,
so if I get you right, you have already C1 and C2 as an example set. In this case you can simply use "generate attributes" to calculate C3.
In case you don't have C2 you can use loop operator to generate is as well.
Cheers
Sachs
input:
?
?
77841
11992369
782045.444
4690112.111
176680.111
--------------------------
output:
?
?
77841
6035105 <== ((77841+11992369)/2)
4284085.148 <== ((77841+11992369+782045.444)/3)
4385591.88875 <== ((77841+11992369+782045.444+4690112.111)/4)
176680.111
It shows how to loop (iterate) through an attribute (column) and write the difference of two proximate data values to a new attribute.
As this is quite similar to your question and provides all the tools (macros, loop, etc.) you need I hope that you can easily adapt it.
In case you still have troubles go as far as you can get and post your code here.
Cheers
Sachs