LabelEncoder使用問題
2020/03/01 05:24 下午
機器學習共學討論版
陳維仁
觀看數:14
回答數:3
收藏數:0
ml100-4
ml100-4-d06
先付上sample code中的截圖
想請問一下,為什麼在做label.fit時,通常只會對training data做,我查了一下.fit的documentation,只有提到Fit label encoder,看了下範例,.fit(y)的功能像是.fit()創一個空字典,y是填入字典的值。這裡附上連結:https://www.itread01.com/content/1503307229.html
問題1: .fit的功能為何?
問題2: 為何.fit只會對training data做?
問題3: 針對問題2,stackoverflow中case2的敘述我不是很懂,為什麼training 和 testing有同樣種類的label是redundant?
https://stackoverflow.com/questions/52279902/sklearn-why-labelencoder-fit-only-to-training-data
非常謝謝您