Overview
A containerized API that forecasts stock prices with Facebook Prophet’s additive model. It downloads price history from Yahoo Finance, fits a Prophet model that captures trend and seasonality, saves the model for fast loading, and serves forecasts from a REST endpoint.
How It Works
Prophet models a time series as a sum of components:
y(t) = trend(t) + seasonality(t) + holidays(t) + error(t)
The pipeline runs in four steps: fetch Yahoo Finance data, train Prophet, serialize with joblib, serve with FastAPI. It accepts any ticker Yahoo Finance knows and a forecast horizon from 1 to 365 days.
Why Prophet?
Stock prices carry strong weekly and yearly seasonality. Prophet handles that without manual seasonal decomposition, tolerates missing data, and adapts to trend changepoints, which matters for financial series with market closures and regime changes.
Tech Stack
- Forecasting: Facebook Prophet
- Data Source: Yahoo Finance (yfinance)
- API Framework: FastAPI and Uvicorn
- Serialization: joblib
- Containerization: Docker