Issue with OneHotEncoder for categorical features

前端 未结 7 1396
耶瑟儿~
耶瑟儿~ 2020-12-05 13:20

I want to encode 3 categorical features out of 10 features in my datasets. I use preprocessing from sklearn.preprocessing to do so as the following:

<         


        
7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 13:42

    If the dataset is in pandas data frame, using

    pandas.get_dummies

    will be more straightforward.

    *corrected from pandas.get_getdummies to pandas.get_dummies

提交回复
热议问题