K Nearest Neighbor

KNN with configurable label prior, chuncking calculation for large data, and estimation of posterior

You are now following this Submission

K nearest neighbor with new features:
1. Configurable Label Weight Prior
2. Calculate distance chunck by chunck (Parallel in the future)
3. Rough estimate of posterior label probability
4. Configurable voting matrix
5. Fully vectorized

Currently a not-so-stable version, if you have any problems, please report here.

@kuantkid

Cite As

Wei LI (2026). K Nearest Neighbor (https://www.mathworks.com/matlabcentral/fileexchange/38004-k-nearest-neighbor), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: Computing Pairwise Distances and Metrics

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

Update due to a lag in matlab central submission procedure.

1.0.0.0