ClusterTools Contents

ClusterTools User Guide

labnn

LABNN

Find indices of nearest neighbors

    [LABELS,NND] = LABNN(TEST,TRAIN,K,PROC)
    [LABELS,NND] = LABNN(TEST,CLASSF,K,PROC)
    [LABELS,NND] = LABNN(TEST,K,PROC)

Input
 TEST Dataset with M objects, doubles or PRTools dataset
 TRAIN Dataset with N objects, doubles or PRTools dataset
 CLASSF- A classifier trained by KNNC. Its training set will be used.
 K Neighbor number to be found
 PROC String indicating procedure to be used in the search, see below.

Output
 LABELS Array with size MxK of indices pointing for each element of
 TEST to the K nearest neighbors in TRAIN.
 NND Vector of length M with nearest neighbor distances.

Description

In PROC one of the following routines can be defined

  • 'prtools' exact computation using PRTools
  • 'ann' approximate computation, needs the ANN Matlab Wrapper
  • 'kdtree' using Matlab's KNNSEARCH with kdtree
  • 'exhaustive' using Matlab's KNNSEARCH with kdtree (default)

In case TRAIN is omitted LABELS point to the nearest neighbors of TEST to itself by a leave-one-out procedure. This is defined only for PROC is 'prtools' only.

See also

datasets, mappings, prmem, proxm, knnsearch,

ClusterTools Contents

ClusterTools User Guide

This file has been automatically generated. If badly readable, use the help-command in Matlab.