Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error #42

Open
Avi3726 opened this issue Mar 1, 2020 · 2 comments
Open

error #42

Avi3726 opened this issue Mar 1, 2020 · 2 comments

Comments

@Avi3726
Copy link

Avi3726 commented Mar 1, 2020

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))

@ruXlab
Copy link

ruXlab commented Apr 29, 2020

Can you elaborate please? What is the error, what were you doing and what is the expected output?

@Akshay-Mutalik
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants