All projects

Amazon Stock Forecasting with LSTM

Deep learning

lookback = 7t−7t−6t−5t−4t−3t−2t−1lstmσσtanhσh(t−1)tclose

A deep-learning notebook that forecasts Amazon’s (AMZN) closing price with an LSTM built in PyTorch.

Each training example is a sliding window of the previous seven closing prices, scaled to the range −1 to 1, and the network learns to predict the next day’s close. Training runs in mini-batches through a custom PyTorch Dataset and DataLoader.

Built with

  • Python
  • PyTorch
  • pandas
  • NumPy
  • scikit-learn
  • Matplotlib
  • Jupyter