Skip to main content

A modular library for benchmarking sequential decision-making models in temporal environments.

Project description

TSDM — Time Series Decision-Making Benchmark (Alpha)

TSDM is a lightweight benchmarking framework for evaluating agents in sequential decision-making tasks based on temporal data.

It provides a clean, Gym-free setup with controlled environments and standardized agents — ideal for systematic experimentation in time-series-only decision-making.


📝 Overview

TSDM focuses on agents that observe a single temporal value at each step and must sequentially decide on a binary action (betting up or down).
Performance is tracked through cumulative rewards based on correct or incorrect predictions.


📦 Installation

From PyPI (Recommended)

pip install tsdm-benchmark

📦 Current Components

✅ Core Agent Classes (agents.py)

  • Abstract Base Class

    • Agent — defines the interface for all agents (observe(), place_bet(), reset())
  • Baseline Heuristic Agents

    • AlwaysUpAgent — Always predicts "up"
    • RepeatLastMovementAgent — Predicts based on last movement direction
    • FrequencyBasedMajorityAgent — Predicts based on majority of past movement directions
  • Statistical Agents

    • StaticMeanReversionAgent — Bets on reversion to historical mean
    • DynamicMeanReversionAgent — Bets on mean reversion within a rolling time window
  • Learning Agents

    • SGDClassifierAgent — Online learning using scikit-learn’s SGDClassifier
    • DQNAgent — Deep Q-Learning agent with experience replay (PyTorch-based)

✅ Sequential Betting Game (games.py)

  • Simulates a sequential game between a time series generator and an agent
  • Handles:
    • Time series generation (requires a generator with .generate_value())
    • Agent action sampling via .place_bet()
    • Reward assignment (+1 correct / -1 incorrect)
    • Step logging and cumulative reward tracking

🎲 Example Usage

from tsdm.agents import AlwaysUpAgent
from tsdm.betting_game import BettingGame
from tsg.generators import LinearTrendGenerator  # Assuming you have tsg-lib

agent = AlwaysUpAgent()
generator = LinearTrendGenerator(slope=0.1)
game = BettingGame(generator=generator, observer=agent, total_movements=1000)

final_reward = game.play_game()
print(f"Final cumulative reward: {final_reward}")

Acknowledgments

Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or European Research Executive Agency (REA). Neither the European Union nor the granting authority can be held responsible for them.

EU Logo

License

MIT — see LICENSE.

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

tsdm_benchmark-0.2.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

tsdm_benchmark-0.2.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file tsdm_benchmark-0.2.0.tar.gz.

File metadata

  • Download URL: tsdm_benchmark-0.2.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for tsdm_benchmark-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a90e5d673e2fa8a7891aed134e3306316612ca784b730b585fa6cb4137275cad
MD5 e53665c4a784fb71f5713bdfc23c7e23
BLAKE2b-256 80c95c52a61e50c1db4370308303e340bfeb545c90b6f31b4c10e331267110de

See more details on using hashes here.

File details

Details for the file tsdm_benchmark-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tsdm_benchmark-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for tsdm_benchmark-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e5ae191107c0ced8018686b3b6879145d9ac7323e26a7e1c3a6709af88561d3
MD5 654344204963231ba7d2042d5130a01b
BLAKE2b-256 3295b2efffba6f9ae212c1b22ecf3bf8d7932a8fdf10a942e9f11e8253839b23

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