Refer to the following papers for a description. Also note that you can play around with the parameters to optimize the performance, if it is not good enough on your dataset, thought it should be.
 R. N. Khushaba, S. Kodagoa, Dikai Liu, and G. Dissanayake, "Electromyogram (EMG) based Fingers Movement Recognition Using Neighborhood Preserving Analysis with QR-Decomposition",
Proceedings of ISSNIP, pp. 1-6, 2011.
 R. N. Khushaba, A. Al-Ani, and A. Al-Jumaily, "Orthogonal Fuzzy Neighborhood Discriminant Analysis for Multifunction Myoelectric Hand Control", IEEE Transaction on Biomedical Engineering, vol. 57, no. 6, pp. 1410-1419, 2010.
Updated and mapping function added again.
Updated for faster implementation.