Skip to main content

Lightweight validation framework for time series forecasting.

Project description

Timeframes

A lightweight framework for time series validation and evaluation.
Timeframes provides simple and efficient tools for splitting, validating, and backtesting forecasting models — without unnecessary dependencies or boilerplate.


🧠 Need help?

Try TimeframesGPT — a specialized assistant trained on the full Timeframes codices.


Installation

pip install timeframes

Quick Example

import timeframes as ts
from sklearn.linear_model import LinearRegression

# Example data
X, y = ts.load_example("air_passengers")

# Split into train, validation, and test
train, val, test = ts.split(X, ratios=(0.7, 0.2, 0.1))

# Validate using walk-forward cross-validation
model = LinearRegression()
report = ts.validate(model, X, y, method="walkforward", mode="expanding", folds=5)

print(report)
# {'mae': 0.213, 'rmse': 0.322, 'smape': 3.9}

Features

  • Minimal — depends only on NumPy and pandas.
  • Consistent — unified API for all validation methods.
  • Flexible — works with any model exposing .fit() / .predict().
  • Transparent — every function returns clear, reproducible outputs.

Supported Methods

Function Description
ts.split() Single train/validation/test split
ts.validate() Cross-validation (walk-forward or temporal K-Fold)
ts.backtest() Out-of-sample testing
ts.evaluate() Metric evaluation (MAE, RMSE, sMAPE, rMAE)

License

MIT License © 2025 Andrew R. Garcia

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timeframes-1.0.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timeframes-1.0.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file timeframes-1.0.0.tar.gz.

File metadata

  • Download URL: timeframes-1.0.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for timeframes-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f8e7111540577d92d0d98016f9d2ea8126a6afd8d03b53cf97fbe3e5b8b86ef9
MD5 b89f29e209cd546592f377a5e516ce5d
BLAKE2b-256 c325c254aa8a047d7d6b1dbc75b98ca908e4a2b393fbf3ec866700e1c2e81408

See more details on using hashes here.

File details

Details for the file timeframes-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: timeframes-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for timeframes-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f899a0b251d960b7d8adef53a094f407b28bf37e2dcc6c169ca5b2ff36a1c45
MD5 dc33c5215a1584d1e30f1731ba3a17a8
BLAKE2b-256 1beca8c8877c411c6c4d4d3e9cc1405dfc5ee590fd949d8ba96d6afe210f7c10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page