Skip to content

Forecasting stock prices of S&P500 using RandomForest and LSTM (Pytorch)

Notifications You must be signed in to change notification settings

rupeshghimire7/SP500_TimeSeries_Forecasting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

SP500_TimeSeries_Forecasting

In these notebooks, I have done Time Series Analysis on S&P500 stock prices imported using yfinance library.

Will S&P Increase?

  1. In this notebook, I compared the closing prices of the present day and the next day to create a target. 1 if increase else 0.
  2. Used RandomForestClassifier to classify if the stock price will increase on the next day or not.
  3. Obtained a decent accuracy score.

Pytorch LSTM TimeSeries

  1. Used LSTM to do TimeSeries Analysis in Pytorch.
  2. Utilized Dataset class to use data frame dataset.
  3. The result obtained is shown below.

Result