Modeling Long- and Short-Term Temporal Patterns

felix_w
felix_w New Altair Community Member
edited November 5 in Community Q&A
Dear Rapidminer Community, 

I recently read about Multivariate Time Series Forecasting with LSTMs and tried to rebuild something similar in Rapidminer but I understood that this is only possible when using the Keras Extension? Is this correct? Or is there a way how to do this in Rapidminer without installing and setting up the Keras and Tensor environment?

In general, are there plans to integrate an operator set to quickly deal with LSTMs directly in Rapidminer Studio? Or is there already one and I totally missed it? ;) 

Best regards 
Felix

My sources: 
https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/
https://arxiv.org/pdf/1703.07015.pdf

Best Answer

  • pschlunder
    pschlunder New Altair Community Member
    Answer ✓
    Hi felix_w,
    look out for tomorrows update. Recurrent layer handling (and for now LSTM layers first) will be added to the extension. Then you'll be able to perform multivariate time-series forecasting with the DL ext. as well without having to rely on Keras.
    It will also include some sample processes.

    Btw: Also included will be an operator to load models trained in Keras and apply them in RapidMiner without having to install keras.

    Regards,
    Philipp

Answers

  • hughesfleming68
    hughesfleming68 New Altair Community Member
    edited December 2018
    To be honest, the best way to use Keras in Rapidminer is to first learn how to use it in Python. It is not as straight forward as some of the other extensions. There are no out of the box LSTM operators in Rapidminer but you can do time series forecasting and I get good results from the built in operators. There is also the Deeplearning4j extension that is worth looking at. Learning to use the built in operators will also give you a point of reference to see if LSTM's work well on your data. I have had mixed results.

    I have bought Jason Brownlee's E-books on Deep learning and time series forecasting. They are helpful for getting up to speed with Keras.
    regards,
    Alex
  • felix_w
    felix_w New Altair Community Member
    Hi Alex, 

    thank you very much for your reply! 

    Any chance that there will be "recurrent layers" implemented in the Deep Learning extension in the near future?

    Best regards
    Felix
  • pschlunder
    pschlunder New Altair Community Member
    Answer ✓
    Hi felix_w,
    look out for tomorrows update. Recurrent layer handling (and for now LSTM layers first) will be added to the extension. Then you'll be able to perform multivariate time-series forecasting with the DL ext. as well without having to rely on Keras.
    It will also include some sample processes.

    Btw: Also included will be an operator to load models trained in Keras and apply them in RapidMiner without having to install keras.

    Regards,
    Philipp
  • felix_w
    felix_w New Altair Community Member
    @pschlunder Wow, perfect :):)

    Exactly what I needed! 

    Thank you! 
  • varunm1
    varunm1 New Altair Community Member
    edited December 2018
    @hughesfleming68 One big issue using keras in RM is that it doesn't give clear error details. I am working a lot on applying deep learning in python but when I tried to shift to RM with new Keras extension its throwing different errors. I even posted it in the Keras thread, unfortunately, no response from anyone. The same network, when applied in python, is giving the output. Also, is this keras extension tested with cross-validation (CV) operator? @pschlunder.

    Thanks,
    Varun
  • jczogalla
    jczogalla New Altair Community Member
    Hi @varunm1, the Keras extension might have problems because you might need to specify the different input/output shapes. @pschlunder is not responsible for the Keras extension however (neother am I), so I can not give you more pointers there, sorry.
    The new Deep Learning extension however does not use Python, but DL4J, a Java-native deep learning library. You can create the models with the well-known RapidMiner operator concept, but you can now also load keras models that you built in Python and apply them to RapidMiner example sets. That should also give you more comprehensive error messages if an error occurs.
  • hughesfleming68
    hughesfleming68 New Altair Community Member
    edited December 2018
    @varunm1. I had similar issues and just continued with Keras in Python.You might want to try the new Deeplearning extension that @pschlunder just released. It is based on Deeplearning4J. I have just started to go through the examples. It is probably a good idea to start a new thread just for Deeplearning as it is evolving very quickly.
  • varunm1
    varunm1 New Altair Community Member
    @jczogalla @hughesfleming68 @pschlunder Great. Thanks guys. Will work on the new release of Deep Learning extension.

    Regards,
    Varun
  • luc_bartkowski
    luc_bartkowski New Altair Community Member
    Hi, here's the how-to regarding RapidMiner Keras LSTM input-shape:

    1st: the problem domain: My input data is financial OHLC so 4 attributes/features.
    Additional assumption: Window size in the Window operator = 10, so 10 timesteps.

    I want to do classification, not prediction. Therefore I don't generate a label in the Windowing operator. If you do generate a label in the Window operator, or you use another amount of timesteps, horizon, etc. you have to adjust the parameters below accordingly.

    So in my application his results into an Keras operator input example set off 'n' records with 4*10 = 40 normal (windowed) attributes and a label. The Keras operator input shape is "(40,)" including parentheses and the comma.
    The Add Core Layer Reshape operator, that you add as the first operator within the Keras operator, should get a target shape of "(10,4)".
    This is the point where I suspect everybody goes wrong: Yes, we all use RNN but not as the FIRST operator in the Keras operator but it's the SECOND operator. Therefore output shape consist out of 2 parameters, not 3 (which generates an error).

    Hope this helps.