How to view all U matrix for each iteration in Fuzzy c means clustering ?

1 次查看(过去 30 天)
How to view all U matrix for each iteration in Fuzzy c means clustering ?

采纳的回答

Walter Roberson
Walter Roberson 2015-8-28
Loop around from 1 to the number of iterations you want. The default for fcm() is 100; if you wanted to match that, then you would loop to 100. Call the loop control variable L
In each loop, you would set the random number generator seed to the same value. Then call fcm() passing in your data, then the number of clusters, and then the vector [2, L, 1e-5, 1] which will be your options vector. The second element of the options vector is the number of loop iterations that fcm is to do, so each time you will be telling fcm to do one more iteration than the time you ran it before. Record or otherwise process the U result.
For example:
randseed = 54321;
numcluster = 5;
maxiter = 100;
U = cell(maxiter, 1);
for L = 1 : maxiter
rng(randseed); %must be reset to the same value each time
[~, U{L}, ~] = fcm(YourData, numcluster, [2, L, 1e-5, 1]);
end
Now U{1} will be the U after the first iteration, U{2} will be the U after the second iteration, and so on.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by