LSTM Time Series Forecasting Tutorial in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2021
  • Thank you for watching the video! Here is the Colab Notebook: colab.research.google.com/dri...
    I offer 1 on 1 tutoring for Data Structures & Algos, and Analytics / ML! Book a free consultation here: calendly.com/greghogg/30min
    Learn Python, SQL, & Data Science for free at mlnow.ai/ :)
    Subscribe if you enjoyed the video!
    Best Courses for Analytics:
    ---------------------------------------------------------------------------------------------------------
    + IBM Data Science (Python): bit.ly/3Rn00ZA
    + Google Analytics (R): bit.ly/3cPikLQ
    + SQL Basics: bit.ly/3Bd9nFu
    Best Courses for Programming:
    ---------------------------------------------------------------------------------------------------------
    + Data Science in R: bit.ly/3RhvfFp
    + Python for Everybody: bit.ly/3ARQ1Ei
    + Data Structures & Algorithms: bit.ly/3CYR6wR
    Best Courses for Machine Learning:
    ---------------------------------------------------------------------------------------------------------
    + Math Prerequisites: bit.ly/3ASUtTi
    + Machine Learning: bit.ly/3d1QATT
    + Deep Learning: bit.ly/3KPfint
    + ML Ops: bit.ly/3AWRrxE
    Best Courses for Statistics:
    ---------------------------------------------------------------------------------------------------------
    + Introduction to Statistics: bit.ly/3QkEgvM
    + Statistics with Python: bit.ly/3BfwejF
    + Statistics with R: bit.ly/3QkicBJ
    Best Courses for Big Data:
    ---------------------------------------------------------------------------------------------------------
    + Google Cloud Data Engineering: bit.ly/3RjHJw6
    + AWS Data Science: bit.ly/3TKnoBS
    + Big Data Specialization: bit.ly/3ANqSut
    More Courses:
    ---------------------------------------------------------------------------------------------------------
    + Tableau: bit.ly/3q966AN
    + Excel: bit.ly/3RBxind
    + Computer Vision: bit.ly/3esxVS5
    + Natural Language Processing: bit.ly/3edXAgW
    + IBM Dev Ops: bit.ly/3RlVKt2
    + IBM Full Stack Cloud: bit.ly/3x0pOm6
    + Object Oriented Programming (Java): bit.ly/3Bfjn0K
    + TensorFlow Advanced Techniques: bit.ly/3BePQV2
    + TensorFlow Data and Deployment: bit.ly/3BbC5Xb
    + Generative Adversarial Networks / GANs (PyTorch): bit.ly/3RHQiRj

ความคิดเห็น • 304

  • @GregHogg
    @GregHogg  6 หลายเดือนก่อน +4

    I offer 1 on 1 tutoring for Data Structures & Algos, and Analytics / ML! Book a free consultation here: calendly.com/greghogg/30min

    • @kobiyobi629
      @kobiyobi629 17 วันที่ผ่านมา

      hey link doesn't work. i copied the code exactly and not working please help

  • @marlhex6280
    @marlhex6280 ปีที่แล้ว +5

    Wow the amount of flexibility on the communication is huge, great skill and of course the LSTM skills and python are perfect, can’t say enough thanks Greg.

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Glad to hear it!!

  • @kevinigweh8076
    @kevinigweh8076 ปีที่แล้ว +1

    Your video is amazing, man. Thank you so much. I was having problems understanding time series forecasting but you just made everything so clear and easy to understand. Again, thank you😁😁

  • @teklehaimanotaman3150
    @teklehaimanotaman3150 ปีที่แล้ว +1

    Thank you Greg, you cleared my fear of deep learning.

  • @mandem2735
    @mandem2735 2 ปีที่แล้ว +60

    great video! Thanks for sharing. One comment, hard coding `i+5` in the `df_to_X_f` function will lead to some very unexpected results if the `window_size` is not set to 5. Better would be to use the `window_size` variable here to ensure the slice is always the same as the window. Cheers :)

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +23

      Oops, good catch yes I definitely meant window size, thanks!

    • @freddiesimmons1394
      @freddiesimmons1394 3 หลายเดือนก่อน

      @@GregHogg I'm a complete newbie trying to complete his capstone project in a bootcamp. Knowing that you could make that kind of mistake that even I saw really is going to help me with my imposter syndrome moving forward. Also, 11/10 video

  • @capszabidin9219
    @capszabidin9219 4 หลายเดือนก่อน

    Thank you Greg, perfect explanation and presentation!

  • @PandemicGameplay
    @PandemicGameplay ปีที่แล้ว +3

    Buddy this is the best explanation I have seen on this topic. You are an excellent communicator, if you're not a professor or instructor you should be.

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Glad to hear it!

  • @vskraiml2032
    @vskraiml2032 ปีที่แล้ว

    excellent video and covered all my doubts, thanks Greg...

  • @tertiusmoyo4740
    @tertiusmoyo4740 10 หลายเดือนก่อน +1

    Greg, this has been a great help. Even after 1 year, this remains relevant and super useful. Love it ✅

    • @GregHogg
      @GregHogg  10 หลายเดือนก่อน +1

      Glad to hear it! :)

    • @tertiusmoyo4740
      @tertiusmoyo4740 10 หลายเดือนก่อน

      You know @@GregHogg I saw this and right now I'm trying to apply this in different scenarios. I'm failing to get it right and I am hoping to reach you. Do you have an instagram? LinkedIn?

  • @InamKhan-kg8wx
    @InamKhan-kg8wx ปีที่แล้ว

    Very well explained! Thanks for sharing

  • @nirmagor5390
    @nirmagor5390 8 หลายเดือนก่อน +1

    Beautiful tutorial.
    I would kindly like to get your attention towards some bad practice when using the Numpy skills.
    You can use np.fromfunction( lambda x, y: x+y, shape=(n_windows, window_size) ) to create a matrix of indices and then slicing the df_as_np with the indices matrix to create X. Then you can use np.reshape to convert it to (n_windows, window_size, 1) shape. That avoids any explicit iterations (for loops) and allows numpy's backend to perform parallelism if possible.
    Overall very good and clear tutorial!

  • @jakedawg253
    @jakedawg253 3 หลายเดือนก่อน

    you sir are a thousands times better than my professor appreciate it

  • @rohanjoseph1531
    @rohanjoseph1531 2 ปีที่แล้ว +12

    Good explanation overall for the concept. However, some quick suggestions to make the videos a bit more comprehensive is to explain the key details like what is a tensor and why did you design a 3-D matrix for the model, or the part where you flatten the predictions; instead of just saying that the output will have extra dimensions run the code and exhibit it and then apply flatten.
    Given this, really like your work to help people like me understand Machine Learning from the very basics. 😊

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +7

      I really appreciate feedback like this. Very specific on important ideas like the tensor. I will keep this in mind for sure, and I appreciate your kind words!

  • @kirwakelvinkering3122
    @kirwakelvinkering3122 8 หลายเดือนก่อน

    There was not even a single reason why I should leave without subscribing , leaving this comment and liking the video , what an explanation , what a model 🤗

    • @GregHogg
      @GregHogg  8 หลายเดือนก่อน

      Very nice of you to say! Thank you greatly for the support :)

  • @natalianunez1817
    @natalianunez1817 9 หลายเดือนก่อน

    Hi! I have a question with respect to the 20:07 part where you define the 'linear' function, in case I'm using a variable that doesn't take negatives like the price of an action which one would you recommend? Thank you :)

  • @yousif533
    @yousif533 ปีที่แล้ว +1

    Many thanks for this video. Can we use this method for forecasting univariate time series that involve outliers? If so, how to treat the outliers first?

  • @adithyaprasadpandelu8032
    @adithyaprasadpandelu8032 8 หลายเดือนก่อน

    Thanks Greg, for the very informative content on LSTM. It's been great help!

    • @GregHogg
      @GregHogg  8 หลายเดือนก่อน

      You're very welcome Adithya!

  • @dewman7236
    @dewman7236 2 ปีที่แล้ว

    I have a question. How do I line up the Dates with the corresponding actual values and predicted values? It seems like the lengths don't matchup

  • @manuelnovella39
    @manuelnovella39 ปีที่แล้ว

    Thanks for the video! Exactly what I needed

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Really glad to hear that!

  • @afonsolenzi7590
    @afonsolenzi7590 ปีที่แล้ว +2

    Hello congrats amazing video!!
    What should we do differently to consider more variables as X?

  • @amiralioghli8622
    @amiralioghli8622 7 หลายเดือนก่อน +1

    Hi Howell, thank you for sharing your valuable information through this channel. I am one of the new followers of time series. If possible, could you create a series on how to implement Transformers on time series data, covering both univariate and multivariate approaches? Focusing on operations like forecasting, classification, or anomaly detection-just one of these would be greatly appreciated. There are no videos available on TH-cam that have implemented this before. It would be extremely helpful for students and new researchers in the field of time series.

  • @pfinbeijing
    @pfinbeijing 6 หลายเดือนก่อน

    Thank you Greg very much for the course! I have one question: if I want to forecast the temperature at 06:00 based on not one X(parameter) but 10 Xs (parameters) from 00:00-05:00(sliding window of 5) how should I tweak my df_to_X_y function?

  • @davidenzler1691
    @davidenzler1691 9 หลายเดือนก่อน

    This video was really helpful with implementing an LSTM in tensorflow! A lot of sources talk about it as either theoretical or building a toy one from scratch. Nice to actually see a tensorflow workflow used. When you are dealing with n-featured examples in the time series, how would you set up the model layers? For example: lets say you used barometric pressure in addition to temperature so your training matrix now looks like : [[ [x11, x12], [x21, x22], ... [xn1, xn2] ]] where x1 is the first entry in the series, x11 is the first feature of the first entry, and n is the window size. How would you set up the model layers? you would be dealing with a 3D matrix, where the third dimension is another feature matrix of window size n. Would the initial input layer just be a tuple of (5, 2)?
    edit:
    I just realized you have a whole other video on this so I will watch that lol

  • @alperyldrm4788
    @alperyldrm4788 5 หลายเดือนก่อน

    Great video! Thanks for the great content!

  • @elshadpiroghlanov7149
    @elshadpiroghlanov7149 ปีที่แล้ว

    Hi Greg,
    Does your model predict different numbers each time you run it? Could you make it give range instead of one number? Kind of Monte Carlo simulation.

  • @robmeyer7985
    @robmeyer7985 2 ปีที่แล้ว +1

    Greg, Thx for great video. I'm a complete noobie, just starting to learn Python. But I'm confused. I've seen a number of videos with output plots for RNNs where, like this one, the prediction line seems to mirror the actual line, often AFTER (to the right of) the actual. Of course, I could take a stubby pencil and look at the thermometer outside my window and write the temp down and say it was my prediction five minutes ago. Voila! One line of code. But the prediction line should be BEFORE the actual line, no? What am I missing? Am I just not seeing it due to the scale on your graph? Rob

  • @user-db5yy5ro7w
    @user-db5yy5ro7w 5 หลายเดือนก่อน

    Great video! I have a question, do you have to do normalization in time series forecasting, I see it was not presented in the video.Thanks!

  • @aliosman0
    @aliosman0 ปีที่แล้ว

    This video helped me greatly.
    Amazing explanation.
    Thank you.

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Super glad to hear it :)

  • @valdompinga3790
    @valdompinga3790 ปีที่แล้ว

    Hello, amazing video, may I ask something?
    So lets say we were to predict a single value, we don't need to use the time somehow or not? Does the model kinda learns to which time the data sequence is relationed? like: "this values n sequence... must be winter so the prediction is: x!" right???

  • @rodrigorezende2332
    @rodrigorezende2332 2 หลายเดือนก่อน

    Hello, and thanks for the fantastic video. If I may ask, what would you recommend if I look for a specific kind of time series forecasting in which I don't want to give the model the real values x_test? I am pretending to use the model's prediction to create an x_test_model and then use the model on this set to achieve a y_test_model that I can compare with the real y_test.

  • @TomVI1316
    @TomVI1316 11 หลายเดือนก่อน

    Nice tutorial! I'm struggling to conceptually understand what happens when you call predict. I understand the training portion, but how do I get values for say 30 days out? It seems I need to feed it 30 values that I already know the answer for? What is it actually returning when you call predict?!
    For example, if I have a dataset of 100 values with a look back/ window of 5. I want to predict values 100 to 105. I train the model on 95 values and call model.predict on the remaining 5, do I get the predictions for 95-100 or 100-105?

  • @ddddddddee
    @ddddddddee 2 ปีที่แล้ว

    Great VDO mate!!! Keep it up!!

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว

      Thanks so much!

  • @miguelpereira9095
    @miguelpereira9095 6 หลายเดือนก่อน

    Hi, great video! Is it possible to run the data in a sliding window way and update the model as it runs? Thank you

  • @denishaarmstrong8383
    @denishaarmstrong8383 ปีที่แล้ว

    Hi Gregg , when running the predictions :train_results = pd.DataFrame(data={'Train Predictions':train_predictions, 'Actuals':y_train1}) i have noticed that you've used data but no prior reference could you state why?

  • @osmansafi4517
    @osmansafi4517 9 หลายเดือนก่อน

    Do you consider the prediction of first predicted hour in second input to do further prediction?

  • @andrewdornack3373
    @andrewdornack3373 ปีที่แล้ว +1

    Great video. Do you know where I can find more information on how to determine the number of layers when performing the model.add() commands. For example, I believe you used 16 for your LSTM.

  • @yarasd2749
    @yarasd2749 ปีที่แล้ว

    thank you for the very good video ...but isnt working with np Arrays exhust the computer memory during fitting ? can we find another way to prepare the data before training... i am working on a multivariate multistep LSTM model ... i have 90 features to predict ine target value ... with many zeros in the target and also in the input features... it is very hallanging specially for multi step forcasting... any advice!?

  • @tokiniainavictoriotrandria2028
    @tokiniainavictoriotrandria2028 6 หลายเดือนก่อน

    really helpful man, thank u

  • @moondevonyt
    @moondevonyt 2 ปีที่แล้ว

    really awesome video, learned a lot about LSTMs. thank you Greg!

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +1

      Great to hear!!

    • @moondevonyt
      @moondevonyt 2 ปีที่แล้ว

      @@GregHogg do you have anything to predict future stock price? :)

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +1

      @@moondevonyt Yes check my recent Videos :)

    • @moondevonyt
      @moondevonyt 2 ปีที่แล้ว

      @@GregHogg youre the man, thanks!

  • @AGnanaprakasam
    @AGnanaprakasam 4 หลายเดือนก่อน

    Can I use the R2 value to measure the accuracy of the LSTM model in time series prediction?

  • @MeredithSargent
    @MeredithSargent 7 หลายเดือนก่อน

    Hi there! Found this really helpful, but I've managed to confuse myself about the data windowing and the test set. Since every target in y_test (except the last one) is somewhere in X_test, how are we not assuming our solution? I had a look at your stock price notebook and there's the bit about recursive predictions, but you don't have that here. Any clarification?

  • @ebenemmanuel9482
    @ebenemmanuel9482 2 ปีที่แล้ว

    Thank you so much. It definitely was much needed.😇😇

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว

      You're very welcome and happy it helped!

  • @fernandobarajas1665
    @fernandobarajas1665 ปีที่แล้ว

    awesome tutorial bro!!!,any thanks for this video, to confirm, could you say that the 5 data above predict 1 value?

  • @AnandPrakash-lc9nr
    @AnandPrakash-lc9nr หลายเดือนก่อน

    hi Greg, what if my target variable is not normally distributed but positively skewed? what should I do in such case? and also, is it recommended to datetime function as cos and sin of hour, weeks n all to provide it in the x variable?

  • @smvnt3803
    @smvnt3803 6 หลายเดือนก่อน

    Great video, really helped a lot!

    • @GregHogg
      @GregHogg  6 หลายเดือนก่อน +1

      Glad to hear it :)

  • @faisalrashid5293
    @faisalrashid5293 5 หลายเดือนก่อน

    Thanks a lot, Greg

  • @Wissam-rk7tv
    @Wissam-rk7tv ปีที่แล้ว

    great, please how should we prepare our data if we want to predict the temperature in different cities, (redundant dates)??

  • @ericdudgeon1648
    @ericdudgeon1648 2 ปีที่แล้ว +5

    Probably the best video on youtube for LSTM. Question which I cant find anywhere, if I want to apply this and show what my next forecast would be, would I just use model.predict() and pass in the last 5 intervals to get my next hour prediction? I cannot find a good example anywhere of someone actually using the model to forecast.

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +3

      That's very nice of you to say, Eric! Yeah, that's what you would do.

  • @luquinhassvc
    @luquinhassvc ปีที่แล้ว

    Amazing! Congrats for great explanation, my friend. I have a question. If I wanted to forecast future temperature regarding date in the future, how could I do that? Regards, Lucas from Brazil.

  • @ivanperegrin9595
    @ivanperegrin9595 ปีที่แล้ว

    How would we do if we did not know the values ​​of x that correspond to y that we want to forecast?

  • @akashbanerjee6303
    @akashbanerjee6303 2 ปีที่แล้ว

    Great Video Gregg!

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว

      Thanks Akash!

  • @SeamusHarper1234
    @SeamusHarper1234 4 หลายเดือนก่อน

    Would this approach work if you wanted to predict the next say 24 or 96 values, instead of just the next 1?

  • @kenhan168
    @kenhan168 2 ปีที่แล้ว

    awesome, great explanation!

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว

      Thanks Ken, I really appreciate that!

  • @muhammadhafizi5953
    @muhammadhafizi5953 2 ปีที่แล้ว

    Hi may i know how to evaluate the model using rmse, mae, mape and mse?

  • @hnclienteshn4501
    @hnclienteshn4501 2 ปีที่แล้ว

    fantastic, thank you very much for sharing

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว

      You're very welcome!

  • @victorhenostroza1871
    @victorhenostroza1871 2 ปีที่แล้ว

    Hello, how can u predict to future with this code?

  • @ahmedelsayedabdelnabyrefae1365
    @ahmedelsayedabdelnabyrefae1365 ปีที่แล้ว

    Hi Greg, that was a lovely and informative presentation. but you are using the training data again in prediction. so why did we split the data into testing, training, and validation?

  • @jackpickford4896
    @jackpickford4896 2 ปีที่แล้ว

    I have tried creating a similar forecasting model but have to normalise the data, whereas you did not in your code. Is there another reason I'm not understanding that allowed your model to work with the real values?

  • @majamuster2470
    @majamuster2470 7 หลายเดือนก่อน

    Great video! Question: I don’t understand the difference between validation data and test data. You say that test data has not seen the model before, but so did the validation set? I thought we only divide into train and test data

  • @mikekertser5384
    @mikekertser5384 2 ปีที่แล้ว +2

    Thank you.
    What shall be modified in the code in case the X is not a single value (like temperature), but many features vector and y is a single value?

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +3

      I will cover this in the future. But essentially, we'd probably want the single items in each list (the third dimension) to be more values. Then you'd have to change the input shape of the model accordingly

  • @saggiefx
    @saggiefx 2 หลายเดือนก่อน

    Thank you captain.

  • @MikroAaltoUuni7
    @MikroAaltoUuni7 ปีที่แล้ว

    Thank you so much, I followed the tutorial and got my first LSTM network working. I am however having trouble with generating out of sample predictions, I feel like I have tried everything and just can’t crack it. I am using the last batch of the test set to predict the first out of sample data point, but it ends in an error. I feel like it’s a dimension thing. Any help, anyone?

  • @SSJwalker
    @SSJwalker 2 หลายเดือนก่อน

    Why do you use rmse over r2 score? I would like to know thanks!

  • @VijaySuryaVempati
    @VijaySuryaVempati 2 หลายเดือนก่อน

    Can you giv e an example of multivariate forecasting?Also if i have temperature datas in two different files and i want to train the LSTM on both the datasets, how will i include that ? Example: first dataset is say temperature on antartica (-10 to 5 degree celsius) and other file has temperature of south africa(30-50 degree celsius). I cant just simply append both data frames. So do i need to train it twice on both datasets?

  • @muhammedcihadakkaya7140
    @muhammedcihadakkaya7140 ปีที่แล้ว +6

    Hello Greg, first of all, thank you very much for the very lovely and exciting video. I do realize that in the test part, you are not updating the window with the new predictions. So mainly, you are doing predictions for every five timesteps, but then in the window, you are using the actual test values to predict the next value. So my question is did you try in this way as well, and if so, how was your results? Thanks again!

    • @SAMEERTHIGALE
      @SAMEERTHIGALE 6 หลายเดือนก่อน +1

      I have the same question!!

  • @SamuelPhilip-bv3ij
    @SamuelPhilip-bv3ij ปีที่แล้ว +1

    Idk why but I got an error "No file or directory found at model1/" when trying to save the best model

  • @TheTedyoo
    @TheTedyoo ปีที่แล้ว

    Thank you so much, it's very helpful

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      You're very welcome and I'm super glad to hear that :)

  • @arathynair8124
    @arathynair8124 2 ปีที่แล้ว

    How to implement data filling (missing values) using LSTM?

  • @sonthai3118
    @sonthai3118 ปีที่แล้ว

    Great video Greg. Thank you for sharing.
    I have a question. Is it better to perform data normalization/standardization before we start the process? Thank you

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Thank you. As long as you've preprocessed inputs in some form, you probably can't go too wrong

  • @andrewdornack3373
    @andrewdornack3373 ปีที่แล้ว

    This also seems only helpful if you want to predict a singular value in the future. What if you wanted a very large number of predictions?

  • @aShrestha6882
    @aShrestha6882 2 ปีที่แล้ว

    hey I need a help, I got an error saying ( UnimplementedError: Graph execution error:), what should I do?

  • @maysammansor
    @maysammansor ปีที่แล้ว

    great video. Thank you very much

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Very welcome!

  • @yefthajoshuae.1561
    @yefthajoshuae.1561 13 วันที่ผ่านมา

    Hey, can you also forecast time series data like that but using random forest??

  • @hemantnyadav
    @hemantnyadav ปีที่แล้ว

    This video at 13.26 shows a time series function, but it is single-step forecasting only... can you show how to modify it for multistep. I have tried to add multiple labels in the loop but it is not working with LSTM. Thanks, Greg for this video also.

  • @waqitshatasheel5875
    @waqitshatasheel5875 ปีที่แล้ว

    How should I predict feature? Let's say for next 1 week time period? I know val_train is made from historical data with windows size, but how should I make this kind of input for next n days? Thanks.

  • @v1nce418
    @v1nce418 10 หลายเดือนก่อน

    great video, thank you

    • @GregHogg
      @GregHogg  10 หลายเดือนก่อน

      You're very welcome!

  • @laharib7795
    @laharib7795 4 หลายเดือนก่อน

    Which data you as been taken in this video can you please show us or update a dataset your

  • @prernamistri
    @prernamistri ปีที่แล้ว

    Hello, thank you so much for this video, after doing
    train_predictions = model1.predict(X_train1).flatten()
    train_results = pd.DataFrame(data={'Train Predictions':train_predictions, 'Actuals':y_train1})
    train_results
    i got this error:
    ValueError: All arrays must be of the same length
    What should I do ?

  • @deepfxd8
    @deepfxd8 หลายเดือนก่อน

    does the lstm train only on 1 input ? i see this ((70086, 5, 1), for X.shape

  • @JPARK7167
    @JPARK7167 2 ปีที่แล้ว +4

    Great video. I do time series forecasting using ARIMA and Prophet models. I wanted to have a go at a different approach such as LSTM, and this video is very helpful. I do have a couple of questions for you, and all of the readers here. What would I need to do if I wanted to forecast temperature for the next 60 days (or x number of days) with time stamp as our index? Thank you in advance!

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +5

      Thanks Jake!! I'll defer you to the TensorFlow tutorials for this one, it's where I based my lesson off. www.tensorflow.org/tutorials/structured_data/time_series

  • @vexlimits1506
    @vexlimits1506 9 หลายเดือนก่อน

    how would the df_to_X_y function change if instead of only having a date and temperature column you also have a location column because now X would have the format (n_samples, window_size, 2)

  • @didierleprince6106
    @didierleprince6106 ปีที่แล้ว

    Merci 😊

  • @nickcooley8358
    @nickcooley8358 8 หลายเดือนก่อน

    which direction are you feeding the data in the lstm?

  • @mp3311
    @mp3311 2 ปีที่แล้ว +1

    Great! What should I do to improve the accuracy on my trained LSTM model?

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +2

      Dropout, regularization, adjust the model in any way you see fit!

  • @giridharjadala2182
    @giridharjadala2182 2 ปีที่แล้ว

    wow ,you're a GOD!!

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว

      Thank you haha

  • @meysamjavadzadeh
    @meysamjavadzadeh 6 หลายเดือนก่อน

    tnx.nice job

  • @LL-wx1yn
    @LL-wx1yn 5 หลายเดือนก่อน

    Nice Video ! Just think about mention François Chollet and Keras for their tutorial

  • @chaoukimachreki6422
    @chaoukimachreki6422 11 หลายเดือนก่อน

    Bro you sound like Robert Greene and you are just as awesome as he is or even more awesome !

  • @affunafar1423
    @affunafar1423 ปีที่แล้ว

    Sir how can we take all input features that is all columns

  • @clickbaitpolice9792
    @clickbaitpolice9792 2 ปีที่แล้ว

    hey nice video. ive got a question pls answer quick if possible.
    I have a list of time series data for 100 stocks. I want combine them into a single dataframe that has open, close, high etc for each stock. so i'd have multiple rows of the same date.
    My question is, is it possible for me to then create a model to predict change in stock price based on all that data from the single combined dataframe? if so, how?

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +1

      This might help: th-cam.com/video/kGdbPnMCdOg/w-d-xo.html and if you're predicting differences, well, you'd have to make that column.

  • @TheGibberingGoblin
    @TheGibberingGoblin 9 หลายเดือนก่อน +1

    Thanks a bunch! Do you have any advice on how to create confidence intervals for predictions?

    • @SeamusHarper1234
      @SeamusHarper1234 4 หลายเดือนก่อน +1

      I'd like to know that too =)

  • @elispot17
    @elispot17 ปีที่แล้ว

    awesome tutorial bro!!!

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Thank you!!

  • @phatly3884
    @phatly3884 6 หลายเดือนก่อน

    I want to code Boosting LSTM, what should I do? Is it much different from LSTM? Thank you very much.

  • @alessandrocagnola7605
    @alessandrocagnola7605 2 ปีที่แล้ว +1

    I realized it was the previous statement to create a problem:
    model1.add(InputLayer((5, 1)))
    I cancelled one parenthesis believing it was redundant and I wrote model1.add(InputLayer(5, 1))
    but this causes a crash to the following line.
    At the moment it is not exactly clear to me the reason. I have to study about.
    In any case I can go on now.
    Sorry for the inconvenience.

  • @JuanManuelBerros
    @JuanManuelBerros ปีที่แล้ว

    Great stuff Greg! Thanks to this vid I finally got the input dimensions of the LSTM right. One quick question: why is the extra `Dense(8, "relu")` layer necessary, and not just the final Dense(1)?

    • @GregHogg
      @GregHogg  ปีที่แล้ว

      Thank you, and great to hear! I forget the final model but most likely this is for extra complexity

    • @RedRose-ll4tb
      @RedRose-ll4tb 2 หลายเดือนก่อน

      @@GregHogg Hey so, is it okay to put fully connected layer after LSTM Layer? Thank you

  • @tiagobrito9765
    @tiagobrito9765 2 ปีที่แล้ว

    Great video with good explanation!
    But if I want to forecast the values for the next month how should I do it?

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +1

      I would my stock prediction video. And thank you :)

  • @biladerimicin910
    @biladerimicin910 5 หลายเดือนก่อน

    thanks for video

  • @TheySudi
    @TheySudi 2 ปีที่แล้ว +2

    hello
    i'm a beginner of machine learning
    is it important that the index on the dataframe must use a timestamp before being put into the train model?
    is there any effect if the index still uses auto increment?
    sorry for bad english

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +2

      It doesn't do anything once it reaches the NumPy stage. It just allows the use of pandas functions to manipulate the dataframe in pandas

    • @TheySudi
      @TheySudi 2 ปีที่แล้ว +2

      @@GregHogg Thank you so much for your attention
      I have 1 more question
      how to determine a good number of hidden layers and good activation function ?
      I have tried the lstm model with different hidden layer configurations and activation functions several times with my data, but the training results are always not good

  • @hp51877
    @hp51877 7 หลายเดือนก่อน

    Is it necessary to use a MinMaxScaler here?

  • @benpenazek9018
    @benpenazek9018 2 ปีที่แล้ว

    What is the difference between test data and validation data? They seem to be used in the exact same way in your notebook.

    • @GregHogg
      @GregHogg  2 ปีที่แล้ว +1

      Validation is going to be repeatedly checked to pick the best model. Test is saved at the end for a final evaluation of the chosen model