Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
How to view all U matrix for each iteration in Fuzzy c means clustering ?

Risposta accettata

Walter Roberson
Walter Roberson il 28 Ago 2015
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.

Più risposte (0)

Categorie

Scopri di più su Fuzzy Logic Toolbox in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by