seed( ) 用于指定隨機(jī)數(shù)生成時(shí)所用算法開始的整數(shù)值。?
1.如果使用相同的seed( )值帝雇,則每次生成的隨即數(shù)都相同;?
2.如果不設(shè)置這個(gè)值舶掖,則系統(tǒng)根據(jù)時(shí)間來自己選擇這個(gè)值卑硫,此時(shí)每次生成的隨機(jī)數(shù)因時(shí)間差異而不同徒恋。?
3.設(shè)置的seed()值僅一次有效
sklearn里的DecisionTreeRegressor()的random_state:
random_state?:?int, RandomState instance or None, optional (default=None)
If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by?np.random.