4、estneighbourofdisany.exemplar000(d r)2EsuchthatNone-nearer(E d d).Noticethattheremightbemorethanonesuit-ableexemplar.Thisambiguitycapturestherequirementthatanynearestneighbourisadequate.None-nearerisdenedthus:00000000None-nearer(E d d),8(d r)2Ejd;djjd;dj(6.1)InEquation6.1thedistancemetric
7、tconditions:ifnearestrepresentstheexemplar(d r),andexlistrepresentstheexemplarsetE,anddomrepresentsthevectord,000then(d r)2EandNone-nearer(E d d).Code:1.nearest-dist:=innity2.nearest:=undened3.forex:=eachexemplarinexlist3.1dist:=distancebetweendomandth