Search code examples
tensorflowneural-networkkerasartificial-intelligenceforecasting

How can I use multiple datasets with one model in Keras?


I am trying Forex prediction with Keras and Tensorflow using a LSTM Network. I of course want it to train on many days of trading but to do that I would have to give it sequential data with big jumps and phases without movement... when the market is closed... This isn't ideal as it gets "confused" because of these jumps and phases of no movement. Alternatively I an use one day of minute per minute data but this way I have very limited time of training data and the model won't be very good.

Do you have Ideas on how to fix this? here is my current code:

CODE

Thanks


Solution

  • If you plan on fitting multiple datasets as data slices, sequentially, something like this would work:

    for _ in range(10):
    #somehow cut the data into slices and fit them one by one
        model.fit(data_slice, label_slice ......)
    

    As successive calls to fit will train the single model incrementally .