how to determining threshold distance using knn

10 visualizzazioni (ultimi 30 giorni)
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)

Risposte (0)

Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by