I am working on classification data that have 9 classes and so many features.
well, classes are categorical obviously as well as some features. I used the one-hot encoding technique to transform categorical data into numerical.
The question is, can I instead of having 8 or 9 columns for each class, each with a binary value, can I instead have only one class label column, but with values from 0 to 8, where 0 represents the first class and 8 represents the last class?
If this works, can I do the same on the features columns or not?

Thanks in advance...

Note: data in both class labels and the features are nominal, not ordinal.