Passing categorical data to Sklearn Decision Tree

后端 未结 5 2053
攒了一身酷
攒了一身酷 2020-11-28 23:05

There are several posts about how to encode categorical data to Sklearn Decision trees, but from Sklearn documentation, we got these

Some advantages of d

5条回答
  •  隐瞒了意图╮
    2020-11-28 23:49

    For nominal categorical variables, I would not use LabelEncoderbut sklearn.preprocessing.OneHotEncoder or pandas.get_dummies instead because there is usually no order in these type of variables.

提交回复
热议问题