How to use LSTM for multiple individual but predicting at every timestep

My dataset consists of a large (1000s+) number of individuals, who may be considered independent of each other. Each individual has a timeseries of about 10-60 data points (each point being a vector of 8 predictors), and a matched timeseries of outcomes of the same length (one value per time point).

I want to use LSTM to learn how the historical pattern of that individual predicts the outcome, but I want to do that at EVERY timestep - not just for the whole individual.

I can find lots of info on these two extremes:

  • A single very long timeseries, making a prediction at every timestep
  • Multiple cases/individuals, making a SINGLE prediction for each individual.

But in my case I want to make one prediction per timestep for every individual. So I'm convinced I need to do a LSTM with return_sequences=True, but I'm now unsure how I make sure that the LTSM is reset each time a new person's data is fed in. In case it matters, for some individuals there is a warm up where I don't have an outcome value for the first 4 or 5 points, but I would presume to just handle this with a zero as a missing value? (the outcome variable is roughly bell shaped mean=0, std=1)

Topic lstm keras

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.