Stock Prediction Web App
## Project Overview
This project implements an interactive web application with Streamlit to forecast stock prices. It allows the user to select a stock ticker, adjust the prediction timeframe, view historical data, and see future price forecasts generated by Facebook Prophet.
## Data Loading
The yfinance library is used to download historical OHLC price data for the chosen stock. This time series data is then fed into the Prophet forecasting model. Streamlit components like progress indicators and text are used to display load status.
## Data Visualization
Raw price data is visualized with Plotly graphs showing Open and Close prices over time. This allows exploratory analysis of the historical data.
## Forecasting
Facebook Prophet is used to conduct time series forecasting on the stock price data. The predict method generates a future dataframe containing a date column and predicted stock price values for the requested timeframe.
## Visualizations
The Plotly and Prophet charting tools are used to visualize the forecasts. The app shows the raw numerical forecasts, as well as graphs of the predicted forecast trends and decomposition of trend vs seasonal components.
## Interactivity
Streamlit components like dropdown menus, sliders and buttons allow the user to customize the stock and timeframe parameters to suit their analysis needs. This interactivity makes for an engaging, customizable forecasting app.
##Conclusion
This stock prediction web application serves as an excellent demonstration of how to combine multiple Python libraries to build an interactive, useful data science application.
By leveraging Streamlit for the web framework, yfinance for data retrieval, Prophet for forecasting, and Plotly for visualization, the project delivers a robust tool for time series prediction. Users can customize the stock and timeframe, visualize historical data, and interact with the automatically generated forecasts.
The modular structure splits logical components like data loading, transformation modeling, and visualization into separate functions. This makes the code maintainable and extensible. Additional stocks could be added, different models tested, and new visualizations incorporated over time.
---
##Preview
Source Code:
Yahoo Finance: https://finance.yahoo.com/
You can run this locally, running the code on a virtual environment (most IDE's work).
Thanks for reading!
Gerard Puche