logo
Loading...

random state中的seed是什麼意思 - Cupoy

If int, random_state is the seed used by the rando...

ml100-2-d34,ml100-2

random state中的seed是什麼意思

2019/07/14 下午 10:10
機器學習共學討論版
蔡家倫
觀看數:98
回答數:2
收藏數:0
ml100-2-d34
ml100-2

If int, random_state is the seed used by the random number generator

其中的the seed是甚麼意思

謝謝

回答列表

  • 2019/07/14 下午 10:49
    Seanyu.TW
    贊同數:1
    不贊同數:0
    留言數:0

    Hi,

    在使用 train_test_spilt 這個函數時,如果不設定 random_state,那幾乎每次切出來的 training 與 testing 都會不同。但假設我們要重現某些實驗,或是要固定資料集的話呢? 一種做法就是一開始就把資料放到兩個不同的資料夾中;另一種作法則是固定 seed,讓它在切資料集時,每次程式執行時,都從亂數表中同一個地方開始,這樣所得到的 training 與 testing 就會每次都一樣。

  • 2019/07/15 下午 03:00
    張維元 (WeiYuan)
    贊同數:1
    不贊同數:0
    留言數:0

    seed 是一種用來隨機亂數的一種實作依據,這邊有一篇關於隨機科普文章提供參考:https://www.ithome.com.tw/voice/110007


    大部分的隨機(Numpy、Pandas、Python 內建)的都是這樣的做法