STOCK PRICE PREDICTION USING LSTM
What is the Stock Market?
METHODOLOGY
The method for forecasting Google stock prices starts with obtaining 20 years' worth of historical data from Yahoo Finance using the `yfinance` library. For feature engineering, moving averages (100-day and 250-day) and daily percentage changes are computed after the dataset has been cleaned and examined for missing values and basic statistics. For the LSTM model, the data is organised into sequences and the Adjusted Close prices are normalised. RMSE is used to evaluate the model's performance after it has been trained on 70% of the data and evaluated on 30%. By contrasting projected and actual stock prices, predictions are visualised. Lastly, a Streamlit app for real-time stock predictions incorporates the trained model and saves it for later use.
This Stock Market Price Prediction project is designed to forecast stock prices based on historical data. The app’s user-friendly interface allows users to input a stock ticker (e.g., "GOOG") and select a date range, after which the app fetches relevant historical data from Yahoo Finance. A pre-trained LSTM model, known for capturing sequential dependencies in time-series data, is loaded to make predictions. The data is prepared by scaling and windowing, ensuring compatibility with the model’s requirements, and transformed back to the original scale for interpretable predictions. Additionally, the application features visualizations of moving averages over 100, 200, and 250 days, providing users with insights into both short & long term stock price trends. The app displays actual vs. predicted stock prices side by side, both in a table and on a line graph, giving users a clear view of the model’s performance. The LSTM model effectively captures overall price trends, though some deviations suggest areas for potential refinement. For a more comprehensive analysis, including error metrics like MAE & RMSE could help users better understand prediction accuracy. This project illustrates the power of combining machine learning with real-time data visualization to assist users in making informed investment decisions, with future potential to integrate additional models and real-time analysis capabilities to enhance accuracy and usability.Overall, this project highlights the capability of deep learning models to handle complex time-series data in the financial domain, making them powerful tools for real-time forecasting and analysis.
Comments
Post a Comment