I have seen some people change the datatype(from object to category) of the feature they want to encode.