This Streamlit app predicts the future stock prices for selected companies using the Prophet model. It allows users to select a stock, view historical data, and generate forecasts for a specified number of years.
- Select Stock Dataset: Choose from a list of predefined stocks to predict.
- Historical Data Display: View the raw historical data for the selected stock.
- Interactive Plots: Visualize the historical stock prices with interactive plots.
- Future Predictions: Generate and display future stock price predictions using the Prophet model.
- Forecast Components: View components of the forecast such as trends and seasonality.
-
Clone the repository:
git clone https://github.com/yourusername/stock-price-prediction-app.git cd stock-price-prediction-app
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run app.py
-
Open your web browser and navigate to
http://localhost:8501
to access the app.
app.py
: Main application file containing the Streamlit app.requirements.txt
: List of Python packages required to run the app.
- Data Fetching: The app fetches historical stock data from Yahoo Finance starting from January 1, 2015, to the current date.
- Data Visualization: Displays the raw data and an interactive plot of the historical stock prices.
- Model Training: Uses the Prophet model to train on the historical stock price data.
- Forecasting: Generates future stock price predictions based on the trained model.
- Plotting Forecasts: Displays the forecasted stock prices and their components.
streamlit
: For creating the web application.yfinance
: For fetching historical stock data.prophet
: For time series forecasting.plotly
: For interactive data visualization.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.