An interactive Streamlit application for exploring, forecasting and backtesting time-series data.
The toolkit helps analysts and data scientists compare forecasting approaches, test model performance on historical data and interpret forecast accuracy without rebuilding analysis pipelines.
The focus is not only on generating forecasts, but on understanding when they can be trusted.
Add the deployed Streamlit URL here:
https://time-series-toolkit.streamlit.app
- Load repository data, local files, URLs or live currency rates
- Select date and value columns interactively
- Filter datasets containing multiple time series
- Replace zeroes with missing values when appropriate
- Resample to days, business days, weeks, months or years
- Compare simple, double and triple exponential smoothing, auto-ARIMA and Prophet
- Forecast future values or backtest against held-out historical observations
- Evaluate backtests using RMSE and normalised percentage difference (NPD)
- Zoom the final plot by choosing how many historical observations to display
- Adjust the y-axis automatically or manually
- Download forecast results as CSV
- View plain-English interpretation of methods and performance
Forecasting models can appear accurate in-sample but perform poorly when conditions change. This application makes that gap visible through built-in backtesting and error analysis.
Backtesting reserves the most recent observations, fits the model only on earlier data, and compares the predictions with values the model did not see during training.
.
├── app
│ └── time_series_app.py
├── data
├── notebooks
│ └── TS.ipynb
├── src
│ ├── __init__.py
│ └── forecasting.py
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
The original notebook is retained in notebooks/TS.ipynb to document the development process and underlying methodology. The Streamlit application is the main interface.
git clone https://github.com/steviecurran/time-series-toolkit.git
cd time-series-toolkit
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
streamlit run app/time_series_app.py- Choose a data source.
- Select the date and value columns.
- Optionally filter the dataset to one category or series.
- Choose whether to resample the dates.
- Select a forecasting method and forecast horizon.
- Choose Forecast or Test.
- Run the model.
- Adjust the final-plot zoom without refitting the model.
- Review the accuracy measures and download the results.
Filtering is useful when one file contains several distinct time series.
For example, all_stocks_5yr+names.csv contains historical prices for many companies. Selecting a company isolates that company's observations before the series is prepared and modelled.
Best suited to relatively stable series without a clear trend or seasonal structure.
Adds a trend component and is useful when values systematically increase or decrease over time.
Also known as Holt-Winters. Adds both trend and seasonality.
Automatically searches for an ARIMA specification using the observed autocorrelation structure.
Designed for changing trends, missing observations and optional national-holiday effects.
Root mean squared error measures prediction error in the same units as the original series:
$ \mathrm{RMSE} =\sqrt{\frac{1}{n}\sum_{i=1}^{n}(\hat{y}_i-y_i)^2}$
Lower values indicate smaller errors, but the value must be interpreted relative to the scale of the data.
The normalised percentage difference expresses RMSE relative to the mean absolute observed value during the test period:
The app uses this broad interpretation:
| NPD | Interpretation |
|---|---|
| Below 5% | Excellent |
| 5% to below 10% | Good |
| 10% to below 20% | Reasonable |
| 20% or more | Poor |
These are heuristic labels rather than universal performance thresholds.
AirPassengers.csv provides a monthly series with trend and seasonality. A typical workflow is to compare Holt-Winters, ARIMA and Prophet, backtest the latest 12 months, and inspect RMSE and NPD.
all_stocks_5yr+names.csv contains historical prices for many companies. Use the optional filter to select one company and resample to business days if required.
This example illustrates an important limitation: a model can fit historical patterns well but still fail during sudden market changes.
The currency option downloads recent exchange-rate observations. Plot labels identify the rate explicitly, for example:
NZD per GBP
The requested calendar period may contain fewer observations because weekends and market holidays are excluded.
- Streamlit
- NumPy
- pandas
- Matplotlib
- statsmodels
- yfinance
- pmdarima
- Prophet
pmdarima contains compiled extensions. Use the Python and NumPy versions specified in requirements.txt.
- Forecasts are not guarantees and may fail during structural breaks.
- Backtest results depend on the selected horizon and historical period.
- Interpolation during resampling can introduce synthetic observations.
- The heuristic NPD labels should not replace domain-specific acceptance criteria.
- No rolling-origin cross-validation is currently implemented.
- Rolling-origin cross-validation
- Forecast intervals
- Additional baseline models
- Model-comparison table
- Residual diagnostics
- Automated tests
- Continuous integration
This project is released under the MIT Licence.