Some lines between things are clear, others are blurred. When clustering involves fuzzy boundaries between things, fuzzy clustering analysis should be used. How to understand the “fuzziness” of fuzzy clustering: Suppose there are two sets respectively A and B, and there is A member A. The traditional classification concept A either belongs to A or B. In the concept of fuzzy clustering, A can be 0.3 belonging to A and 0.7 belonging to B, which is the “fuzziness” concept.

There are two basic methods of fuzzy clustering analysis: systematic clustering and stepwise clustering.

The system clustering method is similar to the density clustering algorithm, and the stepwise clustering method is the center point clustering method. (Please correct any mistakes here)

Stepwise clustering method is a kind of fuzzy clustering analysis method based on fuzzy division. It determines in advance how many categories the samples to be classified should be divided into, and then classifies them in accordance with the optimal principle. After several iterations, the classification is more reasonable. In the classification process, it can be considered that a sample belongs to a certain class with a certain degree of membership, and another class with a certain degree of membership. In this way, the sample is not explicitly in or out of a particular category. If there are n samples in the sample set to be divided into class C, his fuzzy partition matrix is C × N. The matrix has the following characteristics: ① The sum of the membership degree of each class is 1. ②. Every kind of fuzzy subset is not empty set.

Fuzzy C-means clustering algorithm

Fuzzy C-means clustering algorithm (FCM). Among many fuzzy clustering algorithms, fuzzy C-mean (FCM) algorithm is the most widely used and successful. It obtains the membership degree of each sample point to all class centers by optimizing the objective function, and then automatically classifies the samples.

Principle of FCM algorithm

Suppose we have data set X, and we want to classify the data in X. If these data are divided into C classes, there will be c corresponding class centers as Ci, and each sample Xj belongs to a certain category of Ci and its membership degree is SET as Uij. Then define an FCM objective function and its constraints are as follows:





The objective function (Equation 1) is composed of the membership degree of the corresponding sample multiplied by the distance between the sample and various centers. Equation 2 is the constraint condition, that is, the sum of the membership degree of a sample belonging to all classes should be 1.

Type 1 m is a membership degree factor, generally is 2, | | Xj – Ci | | says Xj Euclidean distance to the center of Ci.

Objective function J as small as possible, said to our requirements to minimum objective function J, here is how to evaluate minimum not derived (for deriving interested can look at this article: blog.csdn.net/on2way/arti…

The iterative formula of Uij is:

The iterative formula of Ci is:

We find that Uij and Ci are interrelated, each contains the other, so the question is, the FCM algorithm starts with neither Uij nor Ci, so how do we solve it? Is very simple, at the beginning of the program when we will be randomly generated a Uij, as long as the value to meet the conditions, and then began to iteration, calculated by Uij Ci, the Ci and can calculate the Uij, repetition, the objective function in the process of J is changing all the time, crepe gradually to stability. So the algorithm converges to a better result when J is not changing.

The number before the clear CLC % comment is where you may need to change it. Xls_name = 'experimental data summary.xls '; % 1. The name of the Excel table to read %df = xlsRead (xls_name); [df,date]=xlsread(xls_name); %data = df(:,2:4); data=df(:,1:3); plot3(data(:,1),data(:,2),data(:,3),'o'); hold on; %time = df(:,1)'; % the date = cell2mat time (date) % = date {3, 1}; time=1:609; %% clustering processing % weight in this part % weight = [1.5,3,2]; % 1,1 % [U,V,objFun] = myfcm(weight, data, 3); % 3. This statement sets the 4 in parentheses to cluster to 4, or 3 to cluster to 3. The options = [3,20,1 e - 6, 0]; cn=4; X=data; [center,U,obj_fcn]=fcm(X,cn,options); Jb=obj_fcn(end); maxU = max(U); index1 = find(U(1,:) == maxU); index2 = find(U(2, :) == maxU); index3 = find(U(3, :) == maxU); Plot3 (X(index1,1), X(index1, 2), X(index1, 3), 'linestyle', 'none', 'marker', 'x', 'color', 'g'); hold on; Plot3 (X (index2, 1), X (index2, 2), X (index2, 3), 'graphics.linestyle', 'none', 'marker', '*', 'color', 'r'); hold on; Plot3 (X (and index3, 1), X (and index3, 2), X (and index3, 3), 'graphics.linestyle', 'none', 'marker', '+', 'color', 'b'); hold on; xlabel('speed','fontsize',12); ylabel('volume','fontsize',12); zlabel('occu','fontsize',12); Title ('FCM method clustering results ');Copy the code