181 - Multivariate time series forecasting using LSTM

Поделиться
HTML-код
  • Опубликовано: 7 дек 2020
  • For a dataset just search online for 'yahoo finance GE' or any other stock of your interest. Then select history and download csv for the dates you are interested.
    Code generated in the video can be downloaded from here:
    github.com/bnsreenu/python_fo...
  • НаукаНаука

Комментарии • 473

  • @DigitalSreeni
    @DigitalSreeni  2 года назад +147

    I should apologize for misspeaking towards the end when it comes to forecasting. I said you can forecast the future 90 days when you do "model.predict(trainX[-n_future])". This is not true; you'd be predicting the past and not the future. This is a multivariate time series which means you need multiple variables as input to predict a single output. The input size shall be (n, 14, 5) where 14 was the number of days we look back and 5 was the number of variables. We only have multiple variables available until the last day in our input. So we can only predict one day into the future. In a single variate time series, you can predict multiple days into the future as you can use your predicted values as input to the model. You cannot do that here as we are not predicting multiple variables. Sorry again for making a rookie mistake. The code on github will be updated accordingly. Thanks to all who alerted me about the mistake.

    • @kirannbhavaraju5978
      @kirannbhavaraju5978 2 года назад +2

      I have a question to ask... You trained the model on windows of 14 days so (14 * 5) was each window and the window was slid several times predicting one "open" price in the future (w.r.t the window). The model described only knows how to process 14 days on inputs.. i.e. (14*5) and give out 1 output. Given this context can you please explain why you are passing the last 90 days to the model when forecasting to predict one value? I would imagine that training and testing/forecasting instance shapes should be the same while training and inferring. I am unable to grasp the concept at the end. :)

    • @dutchy5752
      @dutchy5752 2 года назад +4

      yes exactly, you need predictions of all features to predict the next bar. But I would think in theory this would be possible. So not only predict the Open, but also the other 5 features. I did not do this yet myself but it should be possible, right?

    • @sebastianandrescajasordone8501
      @sebastianandrescajasordone8501 2 года назад +1

      Why isn't it splited into test and train data as in the case of single variate time series? Wouldn't it be the same exercise of predicting a 1 day?

    • @LordUche1
      @LordUche1 2 года назад +8

      Thanks for the great video! My question is how can I do multi-time-step predictions with multivariate time series using LSTM? E.g, How can I predict 10 days into the future with the LSTM model

    • @augustoandre5668
      @augustoandre5668 2 года назад

      Looks like the code wasn't update yet, right?

  • @chenqu773
    @chenqu773 2 года назад +8

    Figuring out the data input is indeed a crutial part of the whole training pipeline. Thank you very much for such a clear explanation and a great tutorial !

  • @joelteixeira3557
    @joelteixeira3557 Год назад +5

    I have been struggling with the input-shape for multivariate time series for such a long time. And finally I found a great explanation for how to prepare my data. Thanks for this.

  • @nazaramin8635
    @nazaramin8635 Год назад

    Many thanks, this is the first time I understand multivariate time series forecasting using lstm.
    You cannt imagine how much I need it, appreciated..

  • @cineart5918
    @cineart5918 3 года назад +5

    The BEST explanation as I saw!!

  • @Wysumay
    @Wysumay 3 года назад +41

    I am french and I understand this video better than any papers or videos that are actually in my own language. Thanks for this amazing explanation !

    • @ivoriankoua3916
      @ivoriankoua3916 Год назад +1

      J'espère que tes etudes avancent bien ou que tu es déja en fonction

    • @lemeuneugeuceu4626
      @lemeuneugeuceu4626 9 месяцев назад

      @@ivoriankoua3916 @Wysumay j'ai besoin d'aide j'essaie de faire la m^me chose mais j'ia toujours une sortie exponentielle

  • @russwedemeyer5602
    @russwedemeyer5602 2 года назад

    Thanks for this great video. It has been extremely helpful.
    At the end of the video you asked for ideas for future videos that would help people get through a difficult subject.
    I have been struggling with implementing Feature Importance for Multivariate Time Series prediction using LSTM.
    I believe this is very valuable for better understanding the predicting model and helping give it credibility. Please consider for a future video.
    Thanks again!

  • @GeorgeSserwadda
    @GeorgeSserwadda 3 года назад +1

    Thank you for the detailed explanation on multivariable input

  • @arhamtaseer1837
    @arhamtaseer1837 Месяц назад

    This has been a huge help for a new project i am working on. I still need to optimize a lot of inputs to the model and implement feature importance methods but this basic framework has been an excellent start!

  • @Absfor30
    @Absfor30 2 года назад

    I love the "I'm done with Covid" tone... again great content! Keep it up!

  • @raphaelguay9342
    @raphaelguay9342 3 года назад +6

    You explained it really well. I was stuck in the datashape things. Now it's crystal clear. Thanks

  • @user-ox9ls9jl1o
    @user-ox9ls9jl1o 3 месяца назад

    You're simply the best. This is torn into pieces

  • @emiliovasquez594
    @emiliovasquez594 Год назад

    The scaling explanation was worth it, great video.

  • @myMathBanks
    @myMathBanks 3 года назад +8

    Thank you for taking the time to explain the input shape! You explained it in a way that helps us develop intuition.

  • @soumyabrata111
    @soumyabrata111 3 года назад +1

    After doodling for past two weeks, finally got some relevant info. Thank you so much Sir

  • @roxennh
    @roxennh 3 года назад +1

    Good day, Sir.! I'm here to express my gratitude. This video has really saved my life. I can't express how grateful I am! I wish you the best of luck in the future.

  • @Jason-wx1tv
    @Jason-wx1tv 2 года назад

    Thank you so much for taking the time to put this together. This has been very helpful.

  • @user-gm9vl3nv8u
    @user-gm9vl3nv8u 7 месяцев назад

    Plainly explained. Enjoyed. Thank you

  • @CodeCult413
    @CodeCult413 3 года назад

    After searching many places, finally I got it.
    Very well explained by you sir.
    Please make a video on Object localization of medical x-ray of chest and brain.

  • @81rashmi
    @81rashmi 3 года назад +4

    Thank you so much for great explanation! I have couple of questions: 1. If I have a monthly data and I would like to forecast next 5 years, then what would be the best size for n_past. Would it be 60 (5 years) or just 12 (1 year). How do we gauge this size. 2. How do I compare validation loss with training loss and what is the good range to consider the validation loss is considerable. Any help in understanding these 2 questions would be appreciated. Thanks!

  • @davidperry8634
    @davidperry8634 3 года назад +1

    The video was very clear and easy to follow, certainly in comparison to your peers. I like how you zoomed in to focus on the important part that you were currently talking about.

  • @vijilakshmi2575
    @vijilakshmi2575 3 года назад

    The concept I am looking for was clearly explained in this video. Thank you so much for sharing your knowledge. even small small things you explain in your videos even though you had already explained in previous videos. thanks a lot.

  • @AzzozAlHasani
    @AzzozAlHasani 5 месяцев назад

    Thank you very much for the trick about reshape predicted data to inverse scale. Lot of videos I watched before just plot the scaled data with predicted data without de-scaling, I was wondering how actually use the model instead of comparing performance. this video is very useful to me.

  • @JonCianci12
    @JonCianci12 7 месяцев назад

    This was excellent! Great work with explaining the input shapes! Your predictions look pretty good also… and we got through Covid… 👍

  • @cahyoardhi
    @cahyoardhi 2 года назад +5

    Thank you for the explanation, really help me for complete my thesis

  • @reidgwn7508
    @reidgwn7508 2 года назад +1

    Fantastic content! The part that you believed you dwelled on was actually the best.

  • @dhruvshettty
    @dhruvshettty 11 месяцев назад

    Thanks a lot for this video. Super helpful to understand how the conversion of timeseries data to a supervised ML problem takes place

  • @user-ej9mc4yz7r
    @user-ej9mc4yz7r 3 года назад +5

    Few times I comment. But I do when really deserved. This is exactly what I am looking for ;easy and simple on any level .Thank you so much
    I have one question: do we use forward walking validation or random validation trsting

  • @chiwenliao2237
    @chiwenliao2237 3 месяца назад

    This video really helps me a lot! Thank you so much!🎉🎉

  • @ptcita16
    @ptcita16 Год назад

    Thanks for that amazing video. Help me a lot with my current work.

  • @cristhianfernandez5883
    @cristhianfernandez5883 2 года назад

    Remember in this example, the first column is the predictable variable.
    Thank you very much for the knowledge you share, greetings from Colombia.

  • @TheHarpanOnly
    @TheHarpanOnly Год назад

    I just started a project similar to this, and every single second in this video is an answer of of my questions during this project. Thank you and GBU.

  • @aliardestani1225
    @aliardestani1225 2 года назад

    I really appreciate the method of your teaching, I've learned a lot from you.

  • @danielesantiago
    @danielesantiago 5 месяцев назад

    Amazing content, thank you. It helped me a lot.

  • @juliansantiagoramirezsanch6006
    @juliansantiagoramirezsanch6006 3 года назад

    Really nice explained! Thanks for this video

  • @nguyenhaituan9838
    @nguyenhaituan9838 2 года назад

    Thank you for very clear tutorial, I deeply appreciated your support.

  • @natdanaipromchai7739
    @natdanaipromchai7739 2 года назад

    Thanks for the video.
    This is what I looking for

  • @arundattagupta2833
    @arundattagupta2833 3 года назад

    Hi , I hope you are doing well. I am new to Deep Learning. This video was very helpful to understand the LSTM implementation.

  • @simmonds788
    @simmonds788 4 месяца назад

    Thank you, has been very useful and clearly explained.

  • @ashration
    @ashration 3 года назад

    Hey, we survived even after Jan 26, 2021. Cheers to that!!! And this video was really thorough and helpful. Thank you so much for this and for all other videos on your channel.

  • @qugen_ai
    @qugen_ai 3 года назад +7

    Very nice explanation Sir, I always get confused with shape of the data which you explained very well. I had one question, when we predict future values, lets suppose daily prediction then the value of future day 1 should be one input for future day 2 and so on. Please let me know if I am wrong. If my thinking is correct then how this prediction is working. If possible please explain.

  • @enriquecatala
    @enriquecatala 3 года назад

    Very well explained! thank you so much for sharing your knowledge!

  • @avcstore9600
    @avcstore9600 Год назад

    great! awesome for your explain about LSTM , thank you sir

  • @programmingskills3404
    @programmingskills3404 3 года назад

    you teaching very well, tanks man

  • @jacknaneek1681
    @jacknaneek1681 2 года назад

    Great video. Great explanation. Very clear and very well done!

  • @zhihuauk5796
    @zhihuauk5796 2 года назад

    Thanks so much Sreeni. It helps me a lot !

  • @prakashd842
    @prakashd842 3 года назад +1

    Hi Sir , i am big fan of you . Learnt lot of stuff from your videos . My sincere thanks for preparing such a awesome practical content .

  • @jaxlone997
    @jaxlone997 3 года назад

    I'm glad I found your channel, that's exactly what I was looking for. It's important to spend time on the details, and the video was perfect!

  • @maryambeygmohammadi2232
    @maryambeygmohammadi2232 Год назад

    Thanks man! Excellent explained!

  • @ebenjacobs6981
    @ebenjacobs6981 2 года назад

    Absolutely loved it. Thanks

  • @vitorfaccocalmon9017
    @vitorfaccocalmon9017 Год назад

    Thank you. A great tutorial!

  • @DisguisedAsMohit
    @DisguisedAsMohit 3 года назад +2

    You made it. As usual, awesome !!

  • @l0ltaha
    @l0ltaha 3 года назад

    Your explanations are absolutely spot on! Please don't think "dwelling" on a topic is a waste; it really helps with understanding! I would have preferred if you could also explain (or trace) the somewhat head scratching logic in those for loops for trainX and trainY but after starring at it for quite some time I was able to understand. Nonetheless, 11/10!! Thank you for these videos.

    • @DigitalSreeni
      @DigitalSreeni  3 года назад +1

      I am glad you find these videos useful. Keep watching :)

    • @l0ltaha
      @l0ltaha 3 года назад

      @@DigitalSreeni I have one question Mr. Sreeni. I was looking for your video #164b becuase in your GitHub I found something I was very interested in, which is the same LSTM forecasting but using the Timeseriesgenerator(). If you can link me the video or any resources that helped you I would be very grateful. Thank you.

  • @dataisamazing3566
    @dataisamazing3566 Год назад

    Thanks for the great video 👍

  • @mertsuluk2117
    @mertsuluk2117 2 года назад

    Perfect. Thank you for perfect presentation

  • @joaoperin8313
    @joaoperin8313 2 года назад

    Nice class! Thank you very much

  • @kentsmith6918
    @kentsmith6918 3 года назад +2

    Great explanation - very thorough & clear!
    Thank you!

  • @HMetaldet
    @HMetaldet Год назад

    Amazing explanation sir

  • @rudela9900
    @rudela9900 3 года назад +5

    Hi Sreeni,
    In this lesson you covered the most important concepts in time series forecasting I can think of. I would very much appreciate if you would expand some of the ideas you mentioned, such as including volume in the forecast, decouple the forecast from pd.to_datetime (use time of day or index as well), further coding ideas, etc.
    Once again, this is by far the most useful, applicable and compelling explanation I've attended. Thanks a lot.

  • @marouasedoud7033
    @marouasedoud7033 Год назад

    thank you so much, you are amazing 🙌

  • @NguyenHuynh-zm7tn
    @NguyenHuynh-zm7tn 2 года назад +1

    Xin cảm ơn tác giả. Một bài hướng dẫn rất hay.

  • @nightline9868
    @nightline9868 10 месяцев назад

    Great Video! Thanks for that.

  • @tomtom-wv3hc
    @tomtom-wv3hc 2 года назад

    Amazing video !!! Pure gold :)

  • @jolittevillaruz5234
    @jolittevillaruz5234 2 года назад

    Thank you very much. You are a very good teacher.

  • @billylam723
    @billylam723 3 года назад

    Neat & Clear! Thank you!

  • @serdilanlunlu1419
    @serdilanlunlu1419 Год назад

    Great tutorial, thanks a lot.

  • @sridharm6865
    @sridharm6865 3 года назад

    Thanks for the detailed explanation.

  • @salvinprasad8592
    @salvinprasad8592 3 года назад +1

    Sir, I am PhD student - I have seen many videos but I love to see your video. When I was doing image processing part, I learnt the most from your videos. Now I am learning multi-step forecast horizon. Again, I am learning the data reshaping part from you. I have not met you but apart from my supervisors and co-supervisors you are one of my guru. Thank you so much sir.

  • @damonlin3495
    @damonlin3495 Месяц назад

    Thank you so much for sharing such a wonderful video! I have a question...In this case, each observation in the dataset has included the past 14 days' stock data, does the sequential time order between the observations still matter when training the classification model? Can random shuffling be used when splitting training and testing data?

  • @dongjunlee5945
    @dongjunlee5945 2 года назад

    Thank you for your vedio. That is so helpful. I have a question about forcast. If I assume that if we have just one Y value at initial time step and have other variables for forcast period, can I use the predicted values as my new input?

  • @aqilahrose
    @aqilahrose 3 года назад

    Thank you so much Sir..really you made my day!!

  • @brightlyricsmusic
    @brightlyricsmusic Год назад

    sir love your videos

  • @ahmadk5844
    @ahmadk5844 9 месяцев назад

    first thank you for the video,
    im new to machine learning and im a little bit confused, why is the target label (Open column) included in the input data (trainX) while training the model?
    should we not split the data into features (input) and target labels?

  • @HiltonFernandes
    @HiltonFernandes 2 года назад

    Great explanation and great technical skills.
    Congratulations !

    • @HiltonFernandes
      @HiltonFernandes 2 года назад

      Could you please be as kind as to share the code that you used in a git repository or a gist ?

    • @DigitalSreeni
      @DigitalSreeni  2 года назад

      Please look at the description under the video for the link to my github repo.

    • @HiltonFernandes
      @HiltonFernandes 2 года назад

      Therefore, your video is complete, professor @@DigitalSreeni !

    • @HiltonFernandes
      @HiltonFernandes 2 года назад

      I've seen so many videos that don't share their code that I forgot to find your sharing information in the video description.

    • @HiltonFernandes
      @HiltonFernandes 2 года назад

      Thanks a lot for that one too, kind sir.

  • @branoraguz6666
    @branoraguz6666 3 года назад

    great video, thank you very much sir

  • @SB-yb3us
    @SB-yb3us 2 года назад

    great content and explanation, thank you!!

  • @polosilva
    @polosilva Год назад

    Awesome channel! Keep up the good work!

    • @DigitalSreeni
      @DigitalSreeni  Год назад

      Gracias. Please keep watching and learning.

  • @dannymichaelball2549
    @dannymichaelball2549 3 года назад

    thanks this was very helpful and you are a cool dude!

  • @SHREYAPAMECHA
    @SHREYAPAMECHA 3 года назад +3

    This video is pretty amazing. The approach you have used is when we want to predict using the existing lag feature values (let's say 'close' in your example). What if I want to use some future scraped feature values for prediction? What will be the input shape then?

  • @jenishmonpara
    @jenishmonpara 2 года назад

    Just to make draw the attention that your channel deserves, if you add ...LSTM ( Stock Price Prediction ) in title, people will come rushing to this video :P

  • @myteachinguum6637
    @myteachinguum6637 3 года назад

    GREAT VIDEO..THANKS ALOT

  • @sivabrahmam622
    @sivabrahmam622 Год назад

    Dear sir, thank you very much for your efforts. Anomalies detect by using SOM (Self-organizing maps by using Keras ). I did not see it in your series of lectures. because that is also one of the best Data anomalies methods. pls, do a video on that sir.

  • @md.samiulbasir9913
    @md.samiulbasir9913 2 года назад

    Hi DigitalSreeni
    I appreciate your work and it helped me a lot. As I'm new, I could not understand the data flow of how the input variables predicted the output. I'm clear about the time series and the cell, but not sure about how the input variables give the output. does the model used the inputs to predict 'open' in the training set and used the weights to make prediction of 'open' from the forecasted time series of inputs?
    Please let me know the data flow and operations through the model.

  • @sauravkr.mahato
    @sauravkr.mahato Месяц назад

    very informative video

  • @lfdbykhani
    @lfdbykhani 3 года назад

    Hi,
    Finally found your channel many of concept is now clearing with the help of your videos.
    Thanks a lot..
    Plz, can u make a video on video classification based on CNN lstm.

  • @ArifHussain-fs5jz
    @ArifHussain-fs5jz Год назад

    well explained sir

  • @adityabik9669
    @adityabik9669 Год назад

    I am an indian. Thank you very much for such a clear explanation and a great tutorial !

  • @smitamahajan6165
    @smitamahajan6165 2 года назад

    Great Explanation.. Very useful

  • @fahemhamou6170
    @fahemhamou6170 Год назад +1

    Thank you very much

  • @fatihaelagri7753
    @fatihaelagri7753 Год назад

    Thank you so much for your effort. I want to know if this method and the code are the same if I have 5 variables as inputs and one output.

  • @ripankumarkundu2348
    @ripankumarkundu2348 3 года назад

    Best explanation sir please make tutorial GAN based anomaly detection for multivariate dataset

  • @jenialherdianto292
    @jenialherdianto292 3 года назад

    Very nice tutorial...

  • @deaw3612
    @deaw3612 2 года назад

    Cool, this video is easy to understand lstm things. And I should using spyder tool for some project it look better than notebook to monitor the parameters

  • @quangtrxuan5786
    @quangtrxuan5786 2 года назад

    thank you very much! your code and teach very useful for my project

    • @DigitalSreeni
      @DigitalSreeni  2 года назад

      You are welcome!

    • @quangtrxuan5786
      @quangtrxuan5786 2 года назад

      my question is that: why I run the prediction for 180 and 90 days, both cases gave diffirences prediction curves and values , those are correct?

  • @vj529
    @vj529 2 года назад

    You have done wonderful job of explaining tech things in simple manner. Although not needed, but apologising frequently shows your humbleness. But believe me, many ppl got their concepts/doubts cleared when you explained them in between, you are great mentor, take a bow !!

    • @DigitalSreeni
      @DigitalSreeni  2 года назад

      Thank you very much for your kind comments :)

  • @sharmilabaskaran7347
    @sharmilabaskaran7347 3 года назад +4

    Hi, Thank you for this amazing video. Could you kindly make a video on multivariate time series anomaly detection using LSTM autoencoder ?

  • @victorgarbit6250
    @victorgarbit6250 4 месяца назад

    Thank you !

  • @abdogassar9246
    @abdogassar9246 Год назад

    Great Always

  • @callmepepapig1946
    @callmepepapig1946 Год назад

    Thank you so much for this

  • @satbirsingh5036
    @satbirsingh5036 2 года назад

    Seriously Great work