Objective
Test demand forecasting before building it into Nebluna's operations system.
Takes a daily sales CSV, generates the forecast and reports MAE, MAPE and RMSE on a held-out tail of the series.
Challenges
- 01Daily sales mix weekly seasonality with a slower annual trend
- 02A forecast without an error estimate is not actionable for ordering stock
- 03NumPy/Pandas C extensions break when conda and pip packages mix
How it was solved
- 01Prophet with weekly and yearly seasonality, separating day-of-week effects from trend
- 02Error metrics on held-out data shown with every forecast
- 03Conda for local development, pip wheels only inside the Docker image
Results
- API deployed on GCP Cloud Run and dashboard on Streamlit Cloud
- OpenAPI docs generated from Pydantic request and response schemas
- pytest suite covering data processing and every API endpoint
Overview
The Streamlit dashboard uploads a CSV with date and sales columns and shows the history, the forecast and the error metrics. It is a client of a REST API that trains and serves the model.
Technical Implementation
Data Processing
DataProcessor checks the required columns, rejects short, negative or constant series, fills gaps and drops outliers beyond three standard deviations.
Model
DemandForecaster wraps Prophet with additive weekly and yearly seasonality. It trains on all but the last 30 days, scores on that tail and generates the future dates.
API
FastAPI exposes health, CSV upload and training, forecast and dataset statistics endpoints. Invalid data returns a 400 with the failed check.
Features
- Historical, Forecast and Metrics tabs with interactive Plotly charts
- Forecast horizon slider and confidence interval toggle
- Validation messages for malformed or insufficient data
- Exploratory analysis notebook
Technologies
- Prophet
- FastAPI
- Streamlit
- Pandas
- Plotly
- Pydantic
- Docker
- GCP Cloud Run
- Python 3.12
