# How to process categorical features with many values? [duplicate]

I want to apply machine learning and deep learning.

I have categorical data on string. My first option was to perform dummy encoding on the columns (scikitlearn). But there are some columns that have thousands of categorical values, if i use dummy encoding, this will expand the dataset enormously.

What other alternative do I have? If I simply perform a label encoder and then scale everything between 0 and 1 it could work?

• Trees don't require encoding... – SmallChess May 5 '17 at 15:18
• This is basically the same question that I answered two days ago here: stats.stackexchange.com/questions/227125/… – kjetil b halvorsen May 5 '17 at 15:39
• The most common and simplest way is to collapse the values or make new variables from it. – SmallChess May 5 '17 at 15:43
• @SmallChess: Yes, but that doesn't really take the problem seriously. If you want/need to take it seriously, see my linked answer above. – kjetil b halvorsen May 5 '17 at 15:52