Another way to modify the k-means procedure is to update the means one example at a time, rather than all at once. This is particularly attractive when we acquire the examples over a period of time, and we want to start clustering before we have seen all of the examples. Here is a modification of the k-means procedure that operates sequentially:

- Make initial guesses for the means
**m**_{1},**m**_{2}, ...,**m**_{k} - Set the counts n
_{1}, n_{2}, ..., n_{k}to zero - Until interrupted
- Acquire the next example,
**x** - If
**m**_{i}is closest to**x**- Increment n
_{i} - Replace
**m**_{i}by**m**_{i}+ (1/n_{i})*(**x**-**m**_{i})

- Increment n
- end_if

- Acquire the next example,
- end_until

This also suggests another alternative in which we replace the counts by constants. In particular, suppose that a is a constant between 0 and 1, and consider the following variation:

- Make initial guesses for the means
**m**_{1},**m**_{2}, ...,**m**_{k} - Until interrupted
- Acquire the next example,
**x** - If
**m**_{i}is closest to**x**, replace**m**_{i}by**m**_{i}+ a*(**x**-**m**_{i})

- Acquire the next example,
- end_until

Thus, the initial value **m**_{o} is eventually
forgotten, and recent examples receive more weight than ancient examples.
This variation of k-means is particularly simple to implement, and it is
attractive when the nature of the problem changes over time and the cluster
centers "drift." It also leads naturally to the idea of self-organizing
feature maps.

Back to Fuzzy k-Means
On to SOFM Up to Clustering