Amazon Stock Forecasting in PyTorch with LSTM Neural Network (Time Series Forecasting) | Tutorial 3

54,827
0
Published 2023-04-08
Thank you for watching the video! Here is the Colab Notebook: colab.research.google.com/drive/1CBIdPxHn_W2ARx4Vo…

The Dataset: drive.google.com/file/d/1MqY9yaql1XQbodFSngsHxGbyL…

Prior Video:    • Deep Learning Hyperparameter Tuning i...  

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

All Comments (21)
  • @arbaazmohammed2041
    Great content here Greg! I had so much to learn from this video, specifically as I coded it along with your video. I also happened to play around with the model architecture and the inputs in terms of trying out a bidirectional LSTM, GRU, increasing sequence length, and by extending the input features by incorporating other columns. Thank you again!
  • @dong1815
    What timing, Greg! You just published a video I was looking for. Thanks a lot!
  • @whichdude420
    Keep it up Greg! Enjoying this series very much 😊
  • Thank you so much I was really struggling figuring out how to format the data to feed into an lstm model in pytorch, this really helped conceptualize it.
  • @robinkhn2547
    Thanks a lot Greg, all your videos on LSTMs are really helping with my Master-Thesis!
  • @grand9757
    Thank you very much for the clear instructions! Thanks to you, I launched my first neural network! Greetings from Russia :)
  • @googm
    You have an irregularly sampled time series (so under this approach t-7 for one row may actually be 9 days prior). I realize opening that can of worms gets into a whole niche-y area rife with salami slicing publications. But would've been really great to see it addressed with a carry forward or something.
  • @e.s298
    Hi Greg, is it ok scaling the entire data? Bcz most of the time we do scale only the train set
  • @pfinbeijing
    thank you Greg! I'm curious if you include more parameters in X( training datasets), for example 5 parameters instead of 1 parameter, but also look back 7 days, how to reshape your data input (X_Train) structure? thanks!
  • @evolv_85
    If you only scale the X data and not the y data, the predictions will be in normal scale and there is no need to perform inverse transform on y_pred. 😀
  • @MrCelal1998
    Hello Greg, nice video its really helping to understand deeply LSTM and PyTorch, I have a one question. If we need to add more than one features to predict what we need to do on lookback ?
  • @karlbooklover
    Hi Greg, great content! Just wanted to say that the win-rate is more useful to test if the model is any good, you can calculate the winrate by simply counting how many times the predicted direction (up/down) is correct
  • @xflory26x
    Why do we need to do the min-max scaling to the data if there is only one feature? Also, why is it necessary that we create a custom dataclass? Can you elaborate on that?
  • @learn_techie
    Can you explain why every content on Tensor Flow is shitting image recognition? And if we want to build visualization , data pipeline, real time cluster and decision making ? Shall I go with Pytorch? I guess tensor flow either don't has utility for numbers?
  • @ArthurRabatin
    Hello, great tutorrial! Since you made a comment on the inversion: To avoid the workaround with the dummies on the inversion, you will need to create 2 different scalers, one for X and one for y. Then you can separately inverse the scale without the need to create the dummy value matrix. Something like this: mm_scaler_x = MinMaxScaler(feature_range=(-1, 1)) mm_scaler_y = MinMaxScaler(feature_range=(-1, 1)) orig_dataset = create_feature_set_df(ds.df['Close'].to_frame(), LOOBACK_STEPS).to_numpy(dtype=np.float32) X_orig = orig_dataset[:, 1:].copy() X_orig = np.flip(X_orig, axis=1) y_orig = orig_dataset[:, 0].copy().reshape(-1, 1) X = mm_scaler_x.fit_transform(X_orig) y = mm_scaler_y.fit_transform(y_orig) Also, since the dataframes/numpy arrays do not contain objects, it is sufficient to use the numpy or dataframe copy functions (no need for deepcopy). Thank you for your great videos! I learn so much from them!