I'm using Matlab to discover some clusters in a dataset that has both numerical (e.g., $) and categorical (e.g.,zip code) variables. I know some tools can handle categorical variables as factors but I'm not sure if this is the case for Matlab.
I'm looking for a good way of representing my categorical variables and I'm not sure that just using dummy variables would be the best way to go. One idea is to represent each digit from my zip code, for example, as a 10 digits long binary variable. By doing so, I would have 50 new binary variables.
- Is this an acceptable way of approaching this problem?
- What other and/or more efficient ways of representing categorical variables in a hybrid dataset are there?
- Do I actually need to numerically represent my categorical variables or can Matlab actually handle the mixed dataset?