Skip to content

brodynelly/ML-stock-prediction-webpage

Repository files navigation

Stock Forecasting App

License: MIT CI Python

A Streamlit application for forecasting stock prices using Prophet and yfinance.

Features

  • Data Loading: Fetches historical stock data (AAPL, GOOG, MSFT, GME) from Yahoo Finance.
  • Data Visualization: Interactive plots of historical open and close prices using Plotly.
  • Forecasting: Predicts future stock prices for up to 4 years using the Prophet model.
  • Caching: Efficient data loading with Streamlit's caching mechanism.

Stack

  • Python: 3.10+
  • Streamlit: Web application framework.
  • Prophet: Time series forecasting.
  • yfinance: Market data downloader.
  • Plotly: Interactive graphing library.
  • Pandas: Data manipulation and analysis.

Setup

Prerequisites

  • Python 3.10 or higher
  • pip

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/stock-forecasting.git
    cd stock-forecasting
  2. Create a virtual environment (optional but recommended):

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install the package in editable mode with development dependencies:

    pip install -e .[dev]

Usage

Run the Streamlit app:

streamlit run src/stock_forecasting/app.py

Open your browser at http://localhost:8501.

Development

Running Tests

pytest

Linting and Formatting

This project uses Ruff for linting and formatting.

ruff check .
ruff format .

Type Checking

mypy src

Architecture

The application is structured as follows:

  • src/stock_forecasting/: Source code.
    • app.py: Main Streamlit application entry point.
    • utils.py: Utility functions for data loading, model training, and forecasting.
  • tests/: Unit tests.

License

MIT

About

ML-powered stock price prediction web app using FBProphet and yFinance. Built with Python and Streamlit for interactive forecasting. Live demo available.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors