GDBT那一個部分有用到隨機性?
2019/06/30 下午 07:34
機器學習共學討論版
Wei Yee Lim
觀看數:33
回答數:3
收藏數:0
ml100-2
ml100-2-d47
老師,想問一下,為什麼這個程式例子,第一次和下一次的執行結果不一樣執行,我沒有印象,GDBT那一個部分有用到隨機性,還是我那裡漏掉了?
因為我加上了random_state=常數,結果就固定了,所以想來問一下這情況。
另外為什麼這例子是使用regression,這資料(wine)不是分類資料嗎?
回答列表
-
2019/07/01 下午 06:43Jimmy贊同數:0不贊同數:0留言數:0
Hi Wei Yee Lim!
Sklearn 中有提到這段話
Notes
The features are always randomly permuted at each split. Therefore, the best found split may vary, even with the same training data and
max_features=n_features
, if the improvement of the criterion is identical for several splits enumerated during the search of the best split. To obtain a deterministic behaviour during fitting,random_state
has to be fixed.意思就是要使用 random_state 才會有固定的結果。另外 Regressor 那邊感謝你的提醒,程式碼已經有修正囉
-
2019/07/01 下午 07:38Wei Yee Lim贊同數:0不贊同數:0留言數:0
老師,文中的split是指什麼呢?
-
2019/07/15 上午 10:53張維元 (WeiYuan)贊同數:0不贊同數:0留言數:0
「老師,文中的split是指什麼呢?」
=> 隨機森林用哪個條件「切」這個動作?