Estimated cross-validated test errors for a weighted k-Nearest Neighbors algorithm.

The first 6 and last 6 rows of the data set as well a performance summary matrix.

##   Activity     stage indicator
## 1       40 Stage - W      nap3
## 2      162 Stage - W      nap3
## 3      294 Stage - W      nap3
## 4       54 Stage - W      nap3
## 5        8 Stage - W      nap3
## 6        7 Stage - W      nap3
##       Activity     stage indicator
## 28416        0 Stage - W  night17a
## 28417        0 Stage - W  night17a
## 28418        0 Stage - W  night17a
## 28419        5 Stage - W  night17a
## 28420       93 Stage - W  night17a
## 28421      115 Stage - W  night17a
##        k  sleep   wake   bias
##  [1,]  1 0.9038 0.4348  9.958
##  [2,]  2 0.9082 0.3640 12.917
##  [3,]  3 0.9375 0.4268 12.833
##  [4,]  4 0.9586 0.3258 17.625
##  [5,]  5 0.9537 0.4294 14.333
##  [6,]  6 0.9561 0.4033 15.500
##  [7,]  7 0.9640 0.3934 15.542
##  [8,]  8 0.9721 0.3245 18.583
##  [9,]  9 0.9547 0.4536 13.500
## [10,] 10 0.9559 0.4298 14.292

Given the subject was asleep the algorithm performs well.

Given the subject was awake the algorithm performs poorly.

plot of chunk unnamed-chunk-2