How do I encode the categorical columns if there are more than 15 unique values? I'm trying to use this data to make a data analysis report using regression. Since regression only allows for numerical types, I then need to encode the categorical data. However, most of these have more than 15 unique values such as country.
Do I still use one-hot encoding? Or is there an alternative? Is using regression on this dataset a good idea?
[edit] See also Carlos' answer, I think it's better than mine.
You should use one hot encoding for the categorical features. Replacing categorical values with numerical ones would be a bad idea, because it introduces order between the values and the model would try to find patterns based on this order (e.g. 'x &lt; 4').
If there were really too many different values then it's often a good idea to remove or replace the least common ones, but it doesn't seem to be an issue with this data.
For the record, more than 15 different values is nothing to be afraid of. For example when working with text data it's common to work with thousands of values for a word.