rules/tslearn/kmeans-unseeded-random-state.md

TimeSeriesKMeans, KShape, and KernelKMeans default random_state=None, which draws initial centroids from the global NumPy RNG. Without an explicit seed, cluster labels and barycenters can change across runs.

diff
1-km = TimeSeriesKMeans(n_clusters=3, metric="dtw")
2+km = TimeSeriesKMeans(n_clusters=3, metric="dtw", random_state=0)

What the rule reports

Calls to TimeSeriesKMeans, KShape, or KernelKMeans outside test files that omit random_state=.

How to fix it

Pass an explicit integer seed such as random_state=0.