Vini
Vini

Reputation: 2134

Reading previous values in KNIME

I am working on a project that will update the user about warning based on the previous input trend (Prediction). I am trying to use Supervised learning. As of now I do not have the warning rate for the sample input, but a manually defined Warning rate. I need to generate a target output to feed my learning algorithm.

My approach

I will take the mean of previous 40 input data and add some constant value to the calculated mean and use it as the warning value for the next 40 input values. So there wouldn't be any warning in the first 40 values.

Question

How do I store the mean of previous 40 input values as the Java snippet takes each row at a time during execution? What is the way I can achieve this task?

P.S : No code required, Using KNIME

Upvotes: 1

Views: 864

Answers (2)

InformationEntropy
InformationEntropy

Reputation: 321

If I understand your question correctly, I think you get what you're looking for with the Moving Average Node. You can set the window size and it will output the average of the previous (in your case) 40 elements.

If you have some other value that needs to be shifted relative the other other values, use the Lag Column Node.

Upvotes: 1

Danny
Danny

Reputation: 94

You can use chunk loop to loop in 40 rows and a math formula node can help you to achieve your need

Upvotes: 1

Related Questions