kMeansClustering_b

VQ (vector quantization) of K-means clustering using Forgy's batch-mode method

Contents

Syntax

Description

center = kMeansClustering(data, clusterNum, plotOpt) returns the centers after k-means clustering, where

[center, assignment, distortion, allCenter] = kMeansClustering(data, clusterNum, plotOpt) also returns assignment and distortion, where

Example

DS=dcData(2);
centerNum=8;
plotOpt=1;
[center, assignment, distortion] = kMeansClustering(DS.input, centerNum, plotOpt);
Iteration count = 1/200, distortion = 137.308633
Iteration count = 2/200, distortion = 67.700265
Iteration count = 3/200, distortion = 64.882096
Iteration count = 4/200, distortion = 64.427597
Iteration count = 5/200, distortion = 64.346599
Iteration count = 6/200, distortion = 64.303846
Iteration count = 7/200, distortion = 64.266626
Iteration count = 8/200, distortion = 64.251133
Iteration count = 9/200, distortion = 64.243952
Iteration count = 10/200, distortion = 64.218489
Iteration count = 11/200, distortion = 64.180515
Iteration count = 12/200, distortion = 64.169385
Iteration count = 13/200, distortion = 64.162427
Iteration count = 14/200, distortion = 64.162427

See Also

vecQuantize, vqDataPlot.


Top page   Next: kMeansClusteringOnDist.m   Prev:knncEval.m