(One Example of K-NN in Prediction (Time Series)) |
|||
Line 1: | Line 1: | ||
− | |||
Time Series Estimation Problem | Time Series Estimation Problem | ||
We will estimate value of Y for x = 6. | We will estimate value of Y for x = 6. | ||
X Y distance K-NN value(when K = 2) | X Y distance K-NN value(when K = 2) | ||
− | 1 5 5 | + | 1 5 5 |
− | 2 9 4 | + | 2 9 4 |
3 15 3 | 3 15 3 | ||
− | 4 20 2 20 | + | 4 20 2 20 |
− | 7 30 1 30 | + | 7 30 1 30 |
6 ? | 6 ? | ||
Revision as of 21:58, 5 April 2008
Time Series Estimation Problem We will estimate value of Y for x = 6.
X Y distance K-NN value(when K = 2) 1 5 5 2 9 4 3 15 3 4 20 2 20 7 30 1 30 6 ?
1. Decide K. In this example let K = 2.
2. Find distance from the current X value
3. Decide K-NN value => 20 & 30
4. Estimate Y value by taking K mean values of X
Y = (20+30)/2 = 25
Answer: Estimated(Predicted) Y = 25