Why is different rng(1) rng(2) rng(3) in K means clustering?

9 views (last 30 days)
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
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()
rani Jeong
rani Jeong on 6 Jan 2020
Edited: rani Jeong on 6 Jan 2020
K-means Clustering keeps changing its center and results.
Therefore, the rng function produces the same result.
But rng (1) rng (2) rng (3) .... I didn't understand why this number yields different results.

Sign in to comment.

Accepted Answer

Hiro Yoshino
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.
  1 Comment
rani Jeong
rani Jeong on 6 Jan 2020
If so, the resulting value depends on the seed value 1 2 3 4 5 ... What does seed mean?

Sign in to comment.

More Answers (1)

Hiro Yoshino
Hiro Yoshino on 6 Jan 2020
Yes, you are correct.
Seed is a general terminology in computational sciences -

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!