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.
Rami Khushaba (2020). Fuzzy Neighbourhood Preserving Analysis with QR-Decomposition (https://www.mathworks.com/matlabcentral/fileexchange/33709-fuzzy-neighbourhood-preserving-analysis-with-qr-decomposition), MATLAB Central File Exchange. Retrieved .
Updated and mapping function added again.
Updated for faster implementation.