The Mystery of Seeds~

Simply put, when the random seed is set, it will not reproduce itself and will only correspond to it in the next run.

import numpy as np
i=0
np.random.seed(0)
while(i<3):
    print(np.random.randn(1,5))
    i+=1
print("--------------------------")
i=0
np.random.seed(1)
while(i<3):
    print(np.random.randn(1,5))
    i+=1

Reference: sklearn.model_selection.train_test_split(random_state=42) and np.random.seed(42) connection and principle explanation_Sany He Can's Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/mikewzp/article/details/129692232