泰坦尼克号python数据预处理_sklearn preprocessing 数据预处理(OneHotEncoder)
1.onehotencoderonehotencoder不仅对label可以进行编码,还可对categoricalfeature进行编码:>>>fromsklearn.preprocessingimportOneHotEncoder>>>enc=OneHotEncoder()>>>enc.fit([[0,0,3],[1,1,0],[0,2,1],[1,0,2]])>>>enc.n_values_a