comparison toolboxes/FullBNT-1.0.7/nethelp3.3/kmeans.htm @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 <html>
2 <head>
3 <title>
4 Netlab Reference Manual kmeans
5 </title>
6 </head>
7 <body>
8 <H1> kmeans
9 </H1>
10 <h2>
11 Purpose
12 </h2>
13 Trains a k means cluster model.
14
15 <p><h2>
16 Synopsis
17 </h2>
18 <PRE>
19 centres = kmeans(centres, data, options)
20 [centres, options] = kmeans(centres, data, options)
21 [centres, options, post, errlog] = kmeans(centres, data, options)
22 </PRE>
23
24
25 <p><h2>
26 Description
27 </h2>
28
29 <CODE>centres = kmeans(centres, data, options)</CODE>
30 uses the batch K-means algorithm to set the centres of a cluster model.
31 The matrix <CODE>data</CODE> represents the data
32 which is being clustered, with each row corresponding to a vector.
33 The sum of squares error function is used. The point at which
34 a local minimum is achieved is returned as <CODE>centres</CODE>. The
35 error value at that point is returned in <CODE>options(8)</CODE>.
36
37 <p><CODE>[centres, options, post, errlog] = kmeans(centres, data, options)</CODE>
38 also returns the cluster number (in a one-of-N encoding) for each data
39 point in <CODE>post</CODE> and a log of the error values after each cycle in
40 <CODE>errlog</CODE>.
41
42 The optional parameters have the following interpretations.
43
44 <p><CODE>options(1)</CODE> is set to 1 to display error values; also logs error
45 values in the return argument <CODE>errlog</CODE>.
46 If <CODE>options(1)</CODE> is set to 0,
47 then only warning messages are displayed. If <CODE>options(1)</CODE> is -1,
48 then nothing is displayed.
49
50 <p><CODE>options(2)</CODE> is a measure of the absolute precision required for the value
51 of <CODE>centres</CODE> at the solution. If the absolute difference between
52 the values of <CODE>centres</CODE> between two successive steps is less than
53 <CODE>options(2)</CODE>, then this condition is satisfied.
54
55 <p><CODE>options(3)</CODE> is a measure of the precision required of the error
56 function at the solution. If the absolute difference between the
57 error functions between two successive steps is less than
58 <CODE>options(3)</CODE>, then this condition is satisfied.
59 Both this and the previous condition must be
60 satisfied for termination.
61
62 <p><CODE>options(14)</CODE> is the maximum number of iterations; default 100.
63
64 <p><h2>
65 Example
66 </h2>
67 <CODE>kmeans</CODE> can be used to initialise the centres of a Gaussian
68 mixture model that is then trained with the EM algorithm.
69 <PRE>
70
71 [priors, centres, var] = gmmunpak(p, md);
72 centres = kmeans(centres, data, options);
73 p = gmmpak(priors, centres, var);
74 p = gmmem(p, md, data, options);
75 </PRE>
76
77
78 <p><h2>
79 See Also
80 </h2>
81 <CODE><a href="gmminit.htm">gmminit</a></CODE>, <CODE><a href="gmmem.htm">gmmem</a></CODE><hr>
82 <b>Pages:</b>
83 <a href="index.htm">Index</a>
84 <hr>
85 <p>Copyright (c) Ian T Nabney (1996-9)
86
87
88 </body>
89 </html>