0

I am attempting to create a neural network, however, I am having trouble finding documentation with regards to categorical data.

I have a variable in my dataset which is categorical with 11 levels.

I think I need to convert this variable, however, I'm not sure what to convert it to.

Do I need to create 11 dummy variable to indicate whether or not a value for my categorical variable occurred?

Shahar Hamuzim Rajuan
  • 5,610
  • 9
  • 53
  • 91
John Meighan
  • 69
  • 1
  • 10
  • Yes, if you use `OHE (one hot encoding)`, you can use `feature hashing`, if you have many features, to reduce the number of dummy variables. – Sandipan Dey Feb 02 '17 at 12:18
  • If that categorical variable is not ordinal, I would use one-hot encoding. If you are using python, see here for [pandas](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.get_dummies.html) or here for [scikit-learn](http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html). – Ricardo Magalhães Cruz Feb 02 '17 at 12:41

0 Answers0