#OneHotEncoder 用于將表示分類的數(shù)據(jù)擴維: from sklearn.preprocessing import OneHotEncoder ohe = OneHotEncoder() ohe.fit([[1],[2],[3],[4]]) ohe.transform([2],[3],[1],[4]).toarray() 輸出:[ [0,1,0,0] , [0,0,1,0] , [1,0,0,0] ,[0,0,0,1] ]以上這篇對python 數(shù)...
www.dbjr.com.cn/article/1435...htm 2025-6-3