Skip to content

• Utilized real-time data from Yahoo Finance for accurate stock forecasting and visualize historical and forecasted values, enabling informed decision-making • Leveraged predictive analysis techniques to analyze a stock's historical data using ARIMA and LSTM models

Notifications You must be signed in to change notification settings

KadamPriyanka11/Stock-Price-Prediction-and-Forecasting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Stock-Price-Prediction-and-Forecasting

Predictive Analysis of Stock based on Historical Data in Python The models used are LSTM Model and ARIMA.

Data is dynamically taken from _Yahoo Finance.

The program asks you to enter the Stock Ticker, Start Date and End Date for analysis. Based on your input it will download the historical data from Yahoo Finance.

At first, the program will split the data as 70%-train and 30%-test. I have trained the LSTM model by adding dense=1(1 layer) and lookback is 60. While fitting the epocs are set as 50. Loss function value initially is high but it reduces down and as set epoch 50 to get a better loss function value.

Plotly graphs are used for plotting the time series. You can see

Close values plotted:

image

Results of LSTM Model: The red line are the predictions and green is the original close. As we can see from the graph, the predictions are closer to the original close values.

image

Root Mean Square Error and R2 Score values for the LSTM Model.

image

ARIMA Model

I have used ARIMA(4,1,2) Model for forecasting the future values.

These are ARIMA predictions image

Forecasting using ARIMA image

Results Summary for ARIMA image

Forecasting plotted using plotly graph after taking inverse trasform of the predictions from the results of ARIMA Model Blue line indicates the forcasting values

image

You can compare both and check LSTM and ARIMA. In this scenario I have used Tesla Stock but as I said the program will ask you initially which stock do you want to consider, you can enter the stock ticker value of your desired stock.

Thankyou

About

• Utilized real-time data from Yahoo Finance for accurate stock forecasting and visualize historical and forecasted values, enabling informed decision-making • Leveraged predictive analysis techniques to analyze a stock's historical data using ARIMA and LSTM models

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published