I am trying to use sklearn LabelEncoder but it say that it has no attribute classes_, but it exists, I don't know what is the problem. Here's a snippet of my code
from sklearn.preprocessing import LabelEncoder
encoder = LabelEncoder()
def classes_():
#Return the classes which are classified by this model
return encoder.classes_
def num_of_classes():
"""
Return the number of ouput classes
"""
return len(classes_())
X=TimeDistributed(Dense(output_dim = num_of_classes(),293,activation = "softmax")
However, I get this error AttributeError: 'LabelEncoder' object has no attribute 'classes_'