I have to predict next min traffic for multiple cities (100+). I am thinking of using LSTM. My main concern is how do I scale the number of cities. How does LSTM learn different amount of traffic and other related features of all cities to predict the next state. What should be the network architecture for such cases.

I was thinking of the following process:

  1. Normalisation of the data with city specific Min,Max scalar
  2. Feed sliding window data(t_1 to t_60) to LSTM and predict (t+1) value
  3. Take the output value and get the actuals values from step 1.

I have read multiple papers and blogs online but mostly the deal with one multivariate time-series. But, in my case its multiple multivariate time series but one generalised model. Can someone suggest what are common industry practises for these and related papers/blogs. Do I need to model for each city (Its not possible in my case because of scalability issues?

  • $\begingroup$ I am trying to perform LSTM prediction of a simulation of a computational domain for future time-steps. I have multivariate data for multiple points for multiple time-steps. I want to predict the multivariate data for all points for n+2,n+2 time-steps..I posted a question too This is similar to your problem. Were you able to solve it? $\endgroup$ Jun 14, 2019 at 22:06

1 Answer 1


I think one question you need to answer is how the traffic is correlated across cities.

If they are not correlated (which is likely) then the city can be a categorical input variable. The network can learn what is common across all cities and what is specific to different cities.

Here is a reference that may be helpful. In this example, the inputs are clearly related, so that may be a difference in your case.

You also may consider developing a model for one city, and then improving it by adding other cities.

  • $\begingroup$ Thanks Steven. I have 100+ cities and corresponding 100+ zones for each. So If i try one-hot encoding, 10000 features are added to the network, which makes it quite slow. I am not sure how single network fits all strategy would work. Can you suggest some references. $\endgroup$
    – maggs
    Feb 21, 2019 at 8:14
  • $\begingroup$ Sorry, I don't have any reference. The above is based on my idea of how NN learning works. I think the zones within a city are correlated, so you can one-hot encode the cities, and have a zone id column. $\endgroup$
    – B Seven
    Feb 21, 2019 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.