Fuzzy c-means clustering
To generate a fuzzy inference system using FCM clustering,
use the genfis
command. For example, suppose
you cluster your data using the following syntax:
[centers,U] = fcm(data,Nc,options);
where the first M
columns of data
correspond
to input variables, and the remaining columns correspond to output
variables.
You can generate a fuzzy system using the same training data and FCM clustering configuration. To do so:
Configure clustering options.
opt = genfisOptions('FCMClustering');
opt.NumClusters = Nc;
opt.Exponent = options(1);
opt.MaxNumIteration = options(2);
opt.MinImprovement = options(3);
opt.Verbose = options(4);
Extract the input and output variable data.
inputData = data(:,1:M); outputData = data(:,M+1:end);
Generate the FIS structure.
fis = genfis(inputData,outputData,opt);
The fuzzy system, fis
, contains one fuzzy
rule for each cluster, and each input and output variable has one
membership function per cluster. For more information, see genfis
and genfisOptions
.
Fuzzy c-means (FCM) is a clustering method that allows each data point to belong to multiple clusters with varying degrees of membership.
FCM is based on the minimization of the following objective function
where
D is the number of data points.
N is the number of clusters.
m is fuzzy partition matrix exponent for controlling the degree of fuzzy overlap, with m > 1. Fuzzy overlap refers to how fuzzy the boundaries between clusters are, that is the number of data points that have significant membership in more than one cluster.
xi is the ith data point.
cj is the center of the jth cluster.
μij is the degree of membership of xi in the jth cluster. For a given data point, xi, the sum of the membership values for all clusters is one.
fcm
performs the following steps during
clustering:
Randomly initialize the cluster membership values, μij.
Calculate the cluster centers:
Update μij according to the following:
Calculate the objective function, Jm.
Repeat steps 2–4 until Jm improves by less than a specified minimum threshold or until after a specified maximum number of iterations.
[1] Bezdec, J.C., Pattern Recognition with Fuzzy Objective Function Algorithms, Plenum Press, New York, 1981.