(One Example of K-NN in Prediction (Time Series)) |
|||
Line 2: | Line 2: | ||
We will estimate value of Y for x = 6. | We will estimate value of Y for x = 6. | ||
− | X | + | X = 1 2 3 4 7 6 |
− | + | Y = 5 9 15 20 30 ? | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
1. Decide K. In this example let K = 2. | 1. Decide K. In this example let K = 2. | ||
2. Find distance from the current X value | 2. Find distance from the current X value | ||
+ | |||
+ | distance: 5 4 3 2 1 | ||
3. Decide K-NN value => 20 & 30 | 3. Decide K-NN value => 20 & 30 |
Revision as of 22:00, 5 April 2008
Time Series Estimation Problem We will estimate value of Y for x = 6.
X = 1 2 3 4 7 6 Y = 5 9 15 20 30 ?
1. Decide K. In this example let K = 2.
2. Find distance from the current X value
distance: 5 4 3 2 1
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