A package for visualizing time series model performance with a focus on spatio-temporal datasets.
Project description
timeseriesviz
timeseriesviz is a lightweight Python package for visualizing time series model performance, with a focus on spatio-temporal datasets (e.g., multiple locations, stations, or sensors). It helps researchers and practitioners quickly assess the accuracy of time series forecasts and compare real vs. predicted values across multiple locations.
✨ Features
- Plot aggregated performance across all locations.
- Generate detailed subplots with zoomed-in sections for better error analysis.
- Plot error calculated by (error = actual - forecasted)
- Support for:
- Numpy arrays (
plot_numpy) - Pandas DataFrames from Nixtla’s NeuralForecast (
plot_neuralforecast)
- Numpy arrays (
- Customizable (
splitsize) parameter to specify number of detailed plots to generate. - Option to save plots to disk.
📦 Installation
pip install timeseriesviz
🚀 Usage
Example 1: With Numpy arrays
import numpy as np
from timeseriesviz import plot_numpy
# Simulated data: 100 time steps, 5 locations
y = np.random.rand(100, 5)
pred = y + np.random.normal(0, 0.1, size=y.shape)
fig, axs = plot_numpy(y, pred, title="Forecast vs Actual", splitsize=6)
Example 2: With NeuralForecast DataFrame
import pandas as pd
from timeseriesviz import plot_neuralforecast
# Example NeuralForecast output DataFrame
df = pd.DataFrame({
"unique_id": ["loc1"]*100 + ["loc2"]*100,
"ds": list(range(100))*2,
"y": np.random.rand(200),
"my_model": np.random.rand(200)
})
fig, axs = plot_neuralforecast(df, model_name="my_model", title="NeuralForecast Results", splitsize=6)
📊 Output Example
The generated plots contain:
- Main Plot: Entire aggregated time series (real, predicted, and error).
- Detailed Plots: Split into smaller chunks for clearer inspection.
⚠️ Requirements
pandasnumpymatplotlib
📄 License
MIT License © 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timeseriesviz-0.0.1.tar.gz.
File metadata
- Download URL: timeseriesviz-0.0.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27a09003d57fc064c9168953d52671ca7320af2b92851adc759857a764a4f96d
|
|
| MD5 |
d7af874de55ea61e3952565bd60ed852
|
|
| BLAKE2b-256 |
ffcb0802382094e0238eaf6c37b303275e594d0cd899023515183dcce98960b1
|
File details
Details for the file timeseriesviz-0.0.1-py3-none-any.whl.
File metadata
- Download URL: timeseriesviz-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d96466b1e396677cb331a7b7b17bf2eb3aa3827a85f62f443f4638dcbe118758
|
|
| MD5 |
2acf7c6caa45af05d3e6f2ea006e5032
|
|
| BLAKE2b-256 |
84494f865b8c2204e6082ae53bf87f74c51659a543c4669fef706692351b5958
|