I have a question regarding categorical variables. In the documentation you create dummy variables for the categorical variable, is this necessary?
If I have 200 categories in my categorical variable, I would prefer not to create dummy variables. Can I numerically encode it instead?
In R I would do
as.numeric(as.factor(categorical_variable))
, does this make sense?
Vidar Ingason
06/06/2024, 10:21 PM
I tested this and it worked, so I'm wondering, even though this worked, does this method make sense?
m
Mariana Menchero
06/07/2024, 9:53 PM
Hi @Vidar Ingason, yes, you can also numerically encode them. I used dummy variables to match the Python docs, but in that example we're only using weekdays.