


KNN(1)                   USER COMMANDS                     KNN(1)



NAME
     kmeans - k-means clustering of pattern vectors  within  pat-
     tern classes

SYNOPSIS
     kmeans (-l patterns|-t patterns|-T patterns|-r patterns) (-n
     num_means) modelfile

DESCRIPTION
     kmeans provides a general purpose k-means  clustering  algo-
     rithm  and a simple nearest-neighbour classifier designed to
     operate within the UCL pattern recognition workbench.   Pat-
     tern  vectors  are supplied in two files <pattern>.vec which
     contains the binary floating point data,  and  <pattern>.lab
     which contains the labels and offsets into the .vec file for
     each pattern vector.  The format of the pattern  files  fol-
     lows  the  UCL  pattern recognition workbench standard.  The
     program has three modes of operation: learn, test and recog-
     nise.   For  each mode, the user must supply the basename of
     the a pattern vector file and the name of a file in which to
     write/read the mean vectors.

  LEARNING MODE
     In learning mode, the set of reference patterns is  used  to
     generate  a  set  of k mean vectors (the switch -n specifies
     the size of k) for each pattern class  independently,  these
     are stored in the model file.

  TEST MODE
     In test mode, the model file of means is used in a 1-nearest
     neighbour  procedure  to generate outputs for each vector in
     the test pattern vector files which are then  compared  with
     the  supplied labels. For switch '-t' performance statistics
     are printed, for switch '-T' statistics are saved  into  the
     PRW database /usr/prw/records.

  RECOGNITION MODE
     In recognition mode, the model file of mean vectors are used
     in  a  1-nearest neighbour procedure to generate outputs for
     each vector in the pattern vector files.   The  input  label
     and   the   recognised  output  are  written  to  the  files
     <pattern>.km.i and <pattern>.km.r respectively.

     Options:

     -I         Identify the program name and version.

     -l patterns
                Select learn mode.  Writes mean vectors to model-
                file.

     -t patterns



PRW                     Last change: UCL                        1






KNN(1)                   USER COMMANDS                     KNN(1)



                Select test mode.  Print  statistics  of  perfor-
                mance  of  classifier  on supplied pattern vector
                files using means from  modelfile  and  1-nearest
                neighbour classifier.

     -T patterns
                Select test mode.  Save statistics of performance
                of  classifier  on  supplied pattern vector files
                into PRW record database.

     -r patterns
                Select  recognise  mode.   Output   labels   into
                <pattern>.km.i and <pattern>.km.r.

     -nnummeans Select number of means to save for  each  pattern
                class.  Default is 1. Maximum is 32.

FILES
     /usr/prw/records - PRW statistics records database

VERSION/AUTHOR
     1.1 - Mark Huckvale

SOURCE
     /users/mark/sfs/man/../prw/kmeans.src/kmeans.c






























PRW                     Last change: UCL                        2



