In the case of Temporal data, the goal is to forecast the (n+1)th value or t(n+1) from the previous "n" values. Given, X = {t(1), t(2), ......... , t(n)}, predict the value for t(n+1).
An example with two attributes and a window size, w = 3 is shown below.
| Time | A | B | Insts | A(n-2) | A(n-1) | A(n) | B(n-2) | B(n-1) | B(n) | |
| 1 | 7 | 215 | 1 | 7 | 10 | 6 | 215 | 211 | 214 | |
| 2 | 10 | 211 | => | 2 | 10 | 6 | 11 | 211 | 214 | 221 |
| 3 | 6 | 214 | 3 | 6 | 11 | 12 | 214 | 221 | 210 | |
| 4 | 11 | 221 | 4 | 11 | 12 | 14 | 221 | 210 | 218 | |
| 5 | 12 | 210 | ||||||||
| 6 | 14 | 218 |
Here the number of attributes on the RHS are equal to the number of attributes on the LHS times the window size. In this case for every instance, the value for an attribute at that instant is recorded along with the value for that attribute for the next (w-1) instances. This is repeated for every attribute on the LHS. Now data mining algorithms can be applied to predict A(n) and B(n) when only A(n-2), A(n-1), B(n-2), and B(n-1) are known.
The key issue is how to determine the correct window size, w.
![]()