How to specify a variable in pandas as ordinal/categorical?

后端 未结 3 914
攒了一身酷
攒了一身酷 2020-12-24 15:36

I am trying to run some Machine learning algo on a dataset using scikit-learn. My dataset has some features which are like categories. Like one feature is A, wh

3条回答
  •  爱一瞬间的悲伤
    2020-12-24 16:22

    See https://pandas.pydata.org/pandas-docs/stable/generated/pandas.factorize.html and see this question How to reformat categorical Pandas variables for Sci-kit Learn

提交回复
热议问题