Why is different rng(1) rng(2) rng(3) in K means clustering?
9 views (last 30 days)
Show older comments
i want to know 'why is different rng(1), rng(2), rng(3) in K means clustering?'
Please tell me why,,,
and What is seed? I don't know what you mean after reading the example.
2 Comments
Walter Roberson
on 6 Jan 2020
Which implementation are you looking at? kmeans() from the Statistics and Machine Learning Toolbox does not call upon rng()
Accepted Answer
Hiro Yoshino
on 6 Jan 2020
K means clustering algorithm generates the mean vectors corresponding to the number of the cluster you provide.
The point is that these mean vectors are generated randomly, however the randomness cannot be natural but it is synthesized by computational methods, i.e., the randomness is controllable.
The function rng allows you to controll the randomness by specifying a seed.
More Answers (1)
Hiro Yoshino
on 6 Jan 2020
Yes, you are correct.
Seed is a general terminology in computational sciences -
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!