獨熱編碼 onehot 及python實現

1. 獨熱編碼 獨熱編碼把可列舉型數據,使用0,1進行編碼。 好比, 1 ,2,3 用 [1,0,0], [0, 1, 0], [0, 0, 1] 來表示。web 2. 實現 def oneHot(self, data): ''' 對標籤進行獨熱編碼 輸入:data:array 輸出:onehot data. ''' if data.sh
相關文章
相關標籤/搜索