Adjust Fuzzy Overlap in Fuzzy CMeans
Clustering
This example shows how to adjust the amount of fuzzy overlap when performing fuzzy cmeans clustering. Create a random data set. For reproducability, initialize the random number generator to its default value.
rng 'default' data = rand 00, ;
Specify fuzzy partition matrix exponents.
M = [ . .0 .0 .0];
The exponent values in M must be greater than , with smaller values specifying a lower degree of fuzzy overlap. In other words, as M approaches , the boundaries between the clusters become more crisp.
For each overlap exponent: Cluster the data.
Classify each data point into the cluster for which it has the highest degree of membership.
Find the data points with maximum membership values below 0. . These points have a more fuzzy classification. Calculate the average maximum membership value across all data points to quantify the degree of fuzzy overlap. A higher average maximum membership value indicates that there is less fuzzy overlap.
Plot the clustering results.
for i = :
% Cluster the data.
options = [M i NaN NaN 0];
[centers,U] = fcm data, ,options ;
% Classify the data points.
maxU = max U ;
index = find U ,: == maxU ; index = find U ,: == maxU ;
% Find data points with lower maximum membership values.
index = find maxU < 0. ;
% Calculate the average maximum membership value.
averageMax = mean maxU ;
% Plot the results.
subplot , ,i
plot data index , ,data index , ,'ob' hold on
plot data index , ,data index , ,'or'
plot data index , ,data index , ,'xk','LineWidth',
plot centers , ,centers , ,'xb','MarkerSize', ,'LineWidth', plot centers , ,centers , ,'xr','MarkerSize', ,'LineWidth', hold off
A given data point is classified into the cluster for which it has the highest membership value, as indicated by maxU. A maximum membership value of 0. indicates that the point belongs to both clusters equally. The data points marked with a black x have maximum membership values below 0. . These points have a greater degree of uncertainty in their cluster membership.
More data points with low maximum membership values indicates a greater degree of fuzzy overlap in the clustering result. The average maximum membership value, averageMax, provides a quantitative description of the overlap.
An averageMax value of indicates completely crisp clusters, with smaller values indicating more overlap.
See Also
fcm
Related Examples
Cluster QuasiRandom Data Using Fuzzy CMeans Clustering