From my understanding from SKLearn's documentation, LabelEncoder in SKLearn encodes values between 0 and the number of classes subtracted by 1 (i.e. n_classes - 1).
I wanted to use something similar as a part of a Tensorflow preprocessing operation to avoid using SKLearn for a package. For example, I understand the preprocessing layer provides APIs for OneHot encoding and Categorical Encoding easily as follows:
tf.keras.layers.CategoryEncoding(
num_tokens=None, output_mode='multi_hot', sparse=False, **kwargs
)
Is there any way to use LabelEncoder by certain arguments in the CategoryEncoding API, or do I have to define a brand new pre-processing layer using the abstract base class template provided in the Tensorflow documentations?
If so, is there any possible reference on how I can write my own class for using LabelEncoder as a Tensorflow layer?