Use inverse transform with deep learning Conceptual clarity needed

0 votes

I have built a deep learning model that encoded the value using LabelEncoder() which is further being converted to categorical values using np_utils.to_categorical()

labels = np.array(labels)
transformed_features = docs_encoded.astype(int)
encoder = LabelEncoder()
encoder.fit(labels)
encoded_labels = encoder.transform(labels)
transformed_labels = np_utils.to_categorical(encoded_labels)


Predicting gives me results like : array([[2.40659632e-04, 3.97350988e-04, 4.11552377e-04, ...,

Doing np.argmax(to_categorical(encoder.inverse_transform(encoded_value))) rasies a ValueError: invalid literal for int() with base 10: 'coldstorage'. I know it just means that the argument might be something other than a digit/number. Can't figure this one out. Need help with converting the numbers back to user_ids. Thanks.


My data looks like:
user_id     date                body

mahamudra   2015-01-14T16:52:11 Hi, just search for mahamudra in Evolution.    
mahamudra   2015-01-15T13:55:38 Thank you!  Do I have to register again as vendor?  I tried but it said: 
Shart       2015-02-25T18:43:25 what gives?  is it true missy took the coin and run?
Shart       2015-02-25T18:42:24 people were warned not to use panacea. but no worries,misssy will find a good way to spend your coins.
Mar 21, 2020 in Python by Anan
• 180 points
1,448 views

Hey @Anan,

Can you please provide the code you have written for this? Or if you have used 'int' anywhere in your code, just use 'float' instead of that. I hope your error will go off.

To learn more, visit our deep learning online course

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

+1 vote
1 answer

How to use GUI that comes with Python to test your code?

Hey @alex0809, When your testing a website ...READ MORE

answered Sep 24, 2018 in Python by Vardhan
• 13,190 points
675 views
0 votes
1 answer

Need help with making use of Pluck in Python

Hi, good question. Easy solution to be ...READ MORE

answered Jan 24, 2019 in Python by Nymeria
• 3,560 points
1,435 views
0 votes
1 answer

How do I use lambda() with reduce() in python?

The reduce() function in Python takes in ...READ MORE

answered May 20, 2019 in Python by Umer
1,635 views
0 votes
0 answers

How can we use sqlite with WAL?

Can you give an example? READ MORE

May 29, 2019 in Python by Waseem
• 4,540 points

edited May 30, 2019 by Omkar 428 views
0 votes
1 answer

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Hello @kartik, Since different users might have different ...READ MORE

answered Jun 15, 2020 in Python by Niroj
• 82,880 points
22,887 views
0 votes
1 answer

How to use MySQLdb with Python and Django?

Hello @kartik, I had the same error and pip ...READ MORE

answered Jun 24, 2020 in Python by Niroj
• 82,880 points
511 views
0 votes
1 answer

Role of the bias in neural networks.

Hi@akhtar, The activation function in Neural Networks takes ...READ MORE

answered Jul 15, 2020 in Machine Learning by MD
• 95,440 points
1,242 views
0 votes
1 answer

Handling Imbalanced dataset

This usually occurs when a vast set ...READ MORE

answered Oct 17, 2018 in Data Analytics by kurt_cobain
• 9,390 points
548 views
0 votes
2 answers
0 votes
0 answers

How is AI different from Deep learning?

How is AI different from Deep Learning? READ MORE

Apr 22, 2019 in Others by Halder
340 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP