独热编码 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
相关文章
相关标签/搜索