4

I have 1000 distinct users and the dataset consists activities of these users over the past 1 year. Total records are over 300K. The inputs for the LSTM RNN has the feature vectors corresponding to these users. The user is also included because behavior of each user may vary from person to person. The network should learn behavior of each user and should be able to predict the next behavior based on the past information of the same user. How to maintain separate hidden states for each user within an LSTM RNN.

Following blog post is similar to my problem:

https://towardsdatascience.com/multi-state-lstms-for-categorical-features-66cc974df1dc

Update

My dataset looks like:

DATASET

I transformed my dataset into a 3D the numpy array and reshaped it as (No of records, timesteps, n_features).

The questions are:

1) Is it necessary to encode the "user" attribute?

2) what is the correct batch size for this problem? Is it batch = 1000 (no. of distinct users)?

3) Do I need to include each user's data in each batch input to the model?

OR

Please suggest the correct implementation of this problem.

ab.sharma
  • 180
  • 3
  • 12
  • Hi ab, were you able to find out the solution? How to implement multi-state lstm's for time series forecasting? thanks in advance! – Deepak Jul 19 '20 at 17:30

1 Answers1

0

This is just automatic. You don't need to do anything.

The LSTM layer will certainly have a state matrix the size of your batch of users. (Otherwise it wouldn't be useful)

Daniel Möller
  • 84,878
  • 18
  • 192
  • 214