What is set seed in R
What is set.seed () in R? why is it used in regression and k-means clustering?
Let me explain this issue in simple words,
set seed (value) where value specifies the initial value of the random number seed.
Syntax: set.seed(123)
In the above line,123 is set as the random number value.
The main point of using the seed is to be able to reproduce a particular sequence of 'random' numbers. and sed(n) reproduces random numbers results by seed.
For more information about set.seed in r read the pdf of a few pages that explains all about set.seed in r in detail.
https://www.stata.com/manuals13/rsetseed.pdf
When the k-means clustering algorithm runs, set.seed() is used as a randomly generated seed to determine the starting centroids of the clusters. k-means-clustering-effect-of-random-seed