A kNN Example for Interpolation (Cont.)


The graph results are give below after playing around with the value of K. In general, the plot of kNN smoothing has many discontinuities. For K=1, the kNN smoothing line goes passing all the data points, therefore the sum of square error is zero. The plot is the most rough. When K=5 (all the data point), we get only one horizontal line as the average of all data. Between the two extremes, we can find adjust the value of K as parameter to adjust the smoothing plot. Among K=2, K=3 and K=4, we obtain K=4 have the smallest sum of squared error (SSE) = Σni=1(Xi-X)2.






      “My soul is in the sky.”    
      ― William Shakespeare, A Midsummer Night’s Dream