Skip to content
Sean Mancini. Get in touch

Time Series Forecasting Agent

A forecasting tool I’m building to compare models, evaluate their results, and explain the findings in a report.

Upload a CSV or Excel file, choose the date and value columns, and set how far ahead you want to forecast. The application prepares the data, compares forecasting models, and produces charts and a report you can review and export.

View the project on GitHub · Read an example report (PDF)

From a dataset to a forecast

The project brings data preparation, model evaluation, and reporting into one workflow. It includes a Flask web interface, a FastAPI backend, and a Python forecasting engine.

  1. Prepare the data. Choose how to handle the calendar, missing values, and outliers before running the analysis.
  2. Compare forecasts. Evaluate statistical models alongside simple baselines using rolling backtests.
  3. Review the results. Inspect the forecast, error metrics, prediction intervals, and written analysis. Reports can be exported as PDFs.
Forecast report interface showing the selected model, data quality, review findings, and an executive summary.
Example report interface from the project documentation. View full-size screenshot.

Checking whether a model earns its complexity

The engine compares models such as ARIMA, SARIMA, Holt-Winters, and Prophet against baselines that repeat recent values, follow the latest seasonal cycle, or extend a simple trend. A more complex model has to meet the selection policy’s improvement threshold to replace the best baseline.

Rolling backtests evaluate forecasts at several points in the historical data. Preprocessing is fitted within each training window so validation observations do not influence those preparation steps. When enough history is available, an untouched final period evaluates the selected forecasting procedure.

SARIMA forecast for the airline passengers example, with historical observations, forecast values, and a prediction interval.
Example output using the airline passengers dataset. The displayed metrics describe this example. View full-size chart.

What Python computes and what AI explains

Python fits the models and calculates forecasts, statistical tests, error metrics, and prediction intervals. Language models help interpret the evidence, review results, and write the report. In Auto mode, a language model can recommend an evaluation metric; Python controls the final numerical ranking.

The project supports Gemini and Ollama. Issued forecasts can also be checked against later actual values through the API to track error, bias, interval coverage, and performance against the original baselines.

Source code and setup

The repository includes Docker setup instructions, example data, and documentation covering the forecasting methods and application architecture.