<< evalfls sciFLT fls_structure >>

sciFLT >> sciFLT > fcmeans

fcmeans

Data clustering using fuzzy c-means.

Calling Sequence

[centers,U,ofun,ofunk,em]=fcmeans(Xin,c,m [,maxiter [,epsilon [,verbose]]])

Parameters

Xin:

matrix of reals.The pairs of inputs points.

c:

integer, number of clusters.

m:

scalar, fizzifier constant.

maxiter:

integer, maximum number of iterations. The defaul value is 100

epsilon:

scalar, minimum change value between two consecutive iterations. The default value is 0.001

verbose:

boolean, display information.The default value is %f.

Description

fcmeans find the c number of clusters in the data set Xin using fuzzy c-means algorithm. The centers for each cluster are returned in centers. U contains the grade of membership of each Xin point in each cluster. ofun is the last objetive function. ofunk is the objetive function in each iteration. em is the exit mode, if em is %t then the maximum number of iteration maxiter was reached, if em is %f then the minimum change between iteration epsilon was reached.

Examples

// Take 50 random pairs of points
Xin=rand(100,2);
// Find 7 clusters
[centers,U,ofun,ofunk]=fcmeans(Xin,7,2);
// Display information
scf();clf();
subplot(2,2,1);
plot2d(Xin(:,1),Xin(:,2),-1,rect=[0 0 1 1]);
xtitle("Input pair of points","x","y");
subplot(2,2,3);
plot2d(centers(:,1),centers(:,2),-2,rect=[0 0 1 1]);
xtitle("Cluster centers","x","y");
subplot(2,2,2);
plot(ofunk);
xtitle("Objetive function in each iteration","k","ofun");

See also

Authors


Report an issue
<< evalfls sciFLT fls_structure >>