KNNCLASS

k-Nearest Neighbours classifier.



 Synopsis:
  y = knnclass(X,model)

 Description:
  The input feature vectors X are classified using the K-NN
  rule defined by the input model.
 
 Input:
  X [dim x num_data] Data to be classified.
  model [struct] Model of K-NN classfier:
   .X [dim x num_prototypes] Prototypes.
   .y [1 x num_prototypes] Labels of prototypes.
   .K [1x1] Number of used nearest-neighbours.

 Output:
  y [1 x num_data] Classified labels of testing data.

 Example:
  trn = load('riply_trn');
  tst = load('riply_tst');
  ypred = knnclass(tst.X,knnrule(trn,5));
  cerror( ypred, tst.y )

 See also
  KNNRULE.


Source: knnclass.m

(c) Statistical Pattern Recognition Toolbox, (C) 1999-2003,
Written by Vojtech Franc and Vaclav Hlavac,
Czech Technical University Prague,
Faculty of Electrical engineering,
Center for Machine Perception

Modifications:
19-may-2003, VF
18-sep-2002, V.Franc