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()
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
• 160 points

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,160 points
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,540 points
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
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,530 points

edited May 30, 2019 by Omkar 46 views
+4 votes
8 answers

How can I use Python's range function?

The range function is mostly used in for-loop.  Ex: for ...READ MORE

answered Aug 21, 2018 in Python by Omkar
• 69,000 points
+2 votes
3 answers

what is the practical use of polymorphism in Python?

Polymorphism is the ability to present the ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
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
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
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
0 votes
0 answers

Hello I have some errors while implementing variational autoencoder

def dense_layers(sizes): return tfk.Sequential([tfkl.Dense(size, ...READ MORE

May 18, 2019 in Machine Learning by anonymous

edited May 20, 2019 by Omkar 370 views