Open Avi3726 opened 4 years ago
Can you elaborate please? What is the error, what were you doing and what is the expected output?
lb = LabelEncoder()
y_train = np_utils.to_categorical(lb.fit_transform(y_train)) y_test = np_utils.to_categorical(lb.fit_transform(y_test))
Error: TypeError: Encoders require their input to be uniformly strings or numbers. Got ['int', 'str']
I was changing to categorical values; getting this error
Can I get an early response ...in a bit of hurry
from keras.utils import np_utils from sklearn.preprocessing import LabelEncoder
X_train = np.array(trainfeatures) y_train = np.array(trainlabel) X_test = np.array(testfeatures) y_test = np.array(testlabel)
lb = LabelEncoder()
y_train = np_utils.to_categorical(lb.fit_transform(y_train)) y_test = np_utils.to_categorical(lb.fit_transform(y_test))