chickadee » classifiers » build-one-nn

(build-one-nn training-data target-class #!key metric) procedure

Constructs a simple instance-based classifier, which returns the class of nearest neighbour for any test instance. Training data are a relation, as defined in dataset-utils, and target-class is the name of the attribute to be used for the target classification. metric is a function taking two instance definitions and returning a real number reflecting the distance between the instances; see dataset-utils for some standard metrics. metric defaults to euclidean-distance.