Let's say I have a dataset $\boldsymbol{\mathcal{X}}$ of $N$ samples wherein each sample $\boldsymbol{x}^{(i)}\in \mathcal{X}$, $i \in {1 \ldots N}$, is described by a set of $D$ features, such that $\boldsymbol{x}^{(i)} \in \mathbb{R}^D$, and each component $d$ of $\boldsymbol{x}^{(i)}$, $d \in {1 \ldots D}$, corresponds to a class index corresponding to that feature, i.e., $x^{(i)}_d \in \mathbb{Z}^+$ and could range depending on the number of different classes corresponding to feature $d$.
How can I then visualise elements in this 'space'? Something like PCA does not make sense, as the vectors are just 'holders' of class indices, they are not some representation that really live in a $D$-dimensional space. Right? And as a second question, how to then cluster vectors based on their similarity?
One thing I came up with: for each sample, for each feature, give a point to all other samples for which the class index overlaps (i.e., where $x^{(i)}_d = x^{(j)}_d, i \neq j$). Then you have some sort of similarity measure which you can then possibly exploit to form clusters.
Another idea is to convert all sample vectors to a very big vector that is essentially a concatentation of $D$ one-hot vectors. Though I am not sure whether that is a good option either, because a procedure like PCA or a clustering algorithm does not really know where one 'portion' (corresponding to one feature) in that big vector 'ends', as it threats all dimensions equally, not as belonging to one class.
A third idea is to do something in the realms of 'hierarchical splitting', but I do not really have worked that out yet.
I feel like this is a very elemental question, yet, I could not really find the answer (yet).