kenter image description here

I am training a kNN classifier with 144 features and graphed the accuracy vs number of features used and got this. What might be the reason for the drops in the accuracy at some points of the graph? I am using accelerometer-gyroscope-magnetometer fusion to recognize human activities.

The one presented is validation accuracy. Should I use training accuracy instead? And why?

I ranked the features using ReliefF feature selection algorithm.

I used time domain features such as mean, standard deviation, rms, median, variance, iqr, mad, zcr and mcr, and frequency domain features such as skewness, kurtosis and pca

Here are the top 8 features chosen. Peak accuracy occurs at 8 features. enter image description here

  • $\begingroup$ Are you normalizing the new features?? $\endgroup$ Feb 16, 2017 at 14:50
  • $\begingroup$ No, I edited the question. I did not normalize the features. I just ranked them using ReliefF feature selection algorithm. $\endgroup$
    – mc8
    Feb 16, 2017 at 14:54
  • $\begingroup$ Could you include some examples of the features in your question? $\endgroup$ Feb 16, 2017 at 15:56
  • $\begingroup$ @DanielMesejo done :) $\endgroup$
    – mc8
    Feb 16, 2017 at 16:11

1 Answer 1


I guess the measurements from accelerometer-gyroscope-magnetometer are noisy and redundant in some sense. This means you can find some sort of correlation among the values of the measurements, for instance a correlation between the values from the accelerometer and the gyroscope.

PCA captures the principal directions of variation on your data, removing the correlation between the measurements and also reducing the noise, therefore increasing the accuracy. From the graph it can be seen that the accuracy just diminishes a little when using all the features.

Other factor I will consider is the magnitude of the features, a feature with a very large magnitude affects the behavior of K-NN.

  • $\begingroup$ what other data? $\endgroup$
    – mc8
    Feb 16, 2017 at 16:50
  • $\begingroup$ You mean to say that PCA is sufficient for activity recognition and other data acts as noise? $\endgroup$
    – mc8
    Feb 16, 2017 at 17:02
  • $\begingroup$ I updated my answer, but I guess that PCA may be enough. $\endgroup$ Feb 16, 2017 at 19:52
  • $\begingroup$ if there are redundant features why does the accuracy recover for some number of features used? Does adding some features cancel the redundancies introduced? $\endgroup$
    – mc8
    Feb 16, 2017 at 22:15
  • $\begingroup$ I did not read the second paragraph before typing my comment. haha big thanks! $\endgroup$
    – mc8
    Feb 16, 2017 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.