This question already has an answer here:
I have this categorical variable that represents the country for a person. How can I use this in regression model. If there had been less levels for a category I could have used dummy binary variables to encode them. But in the case of countries, there are more than 200 countries, so it doesn't make sense to use binary variables. What should I do?
Obviously, one of the ways would be to make the variable coarse, take continent instead of country to reduce the levels. But this is not what I want to do?
Lets suppose I have a categorical variable which is the user id. What should I do in this case?