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 in Python by Anan
• 180 points
170 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.

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,200 points
158 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,520 points
355 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
213 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 62 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 in Python by Niroj
• 43,100 points
697 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 in Python by Niroj
• 43,100 points
35 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 14 in Machine Learning by MD
• 41,020 points
24 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,310 points
93 views
0 votes
2 answers

How do neural networks used in AI and deep learning learn?

A neural network is a hardware or software ...READ MORE

answered Apr 8, 2019 in Others by SA
• 1,050 points
173 views
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
61 views