image thumbnail

K Nearest Neighbor

version (2.59 KB) by Wei LI
KNN with configurable label prior, chuncking calculation for large data, and estimation of posterior


Updated 05 Sep 2012

View License

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.


Cite As

Wei LI (2021). K Nearest Neighbor (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Inspired by: Computing Pairwise Distances and Metrics

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!