Clear Filters
Clear Filters

How to create a matrix of the nearest neighbor for each test sample

1 view (last 30 days)
I was using the 'KDTreeSearcher' to find the nearest neghbour for a test data.
KDTreeSearcher
How do I create a matrix where the row is the test sample and the column to indicate that each particular test sample has neigbour to a particular training sample with the value of 1 or 0 (1=neigbbour, 0=not neghbour)?
Second, since I have the above matrix, I also wanted to create another to show the distance from each test sample to the neghbour, how do I do that?

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!