Encoding methods for categorical data