Clear Filters
Clear Filters

how to determining threshold distance using knn

4 views (last 30 days)
Hello everyone
please i still need you
I want to detect defects and classify them using the kNN rule. however with your help I understood a lot about knn.
now i would like to know how to set distance threshold (euclidean).
example Detection rule:
Unclassified incoming sample,Find its nearest neighbor from the training sample,Calculate its distance kNN squared for each sample. Squared kNN distance < threshold, then sample labeled as normal otherwise defective. we can set a threshold with a certain level and the unclassified sample is considered normal if its distance to its nearest neighboring training sample is less than the threshold otherwise the sample is detected as defective. can anyone help me out?. the nominal data belongs to the class
NB: does classification take the place of detection? attached my code, my data (i have 5 class)

Answers (0)

Categories

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

Community Treasure Hunt

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

Start Hunting!