fcm

Fuzzy c-means clustering

Syntax

[center,U,obj_fcn] = fcm(data,cluster_n) 

Description

[center, U, obj_fcn] = fcm(data, cluster_n) applies the fuzzy c-means clustering method to a given data set.

The input arguments of this function are

The output arguments of this function are

fcm(data,cluster_n,options) uses an additional argument variable, options, to control clustering parameters, introduce a stopping criteria, and/or set the iteration information display.

options(1): exponent for the partition matrix U (default: 2.0)

options(2): maximum number of iterations (default: 100)

options(3): minimum amount of improvement (default: 1e-5)

options(4): info display during iteration (default: 1)

If any entry of options is NaN, the default value for that option is used instead. The clustering process stops when the maximum number of iterations is reached, or when the objective function improvement between two consecutive iterations is less than the minimum amount of improvement specified.

Examples

data = rand(100, 2);
[center,U,obj_fcn] = fcm(data, 2);
plot(data(:,1), data(:,2),'o');
maxU = max(U);
index1 = find(U(1,:) == maxU);
index2 = find(U(2, :) == maxU);
line(data(index1,1), data(index1, 2), 'linestyle', 'none', 
'marker', '*', 
'color', 'g');
line(data(index2,1), data(index2, 2), 'linestyle', 'none', 
'marker', '*', 
'color', 'r');


© 1994-2005 The MathWorks, Inc.