Skip to main content

TIMEE: Time Series Classification via In-Context Learning

arXiv HuggingFace License

TIMEE is a pretrained transformer for time series classification. It classifies test series in a single forward pass given labeled training examples — no per-dataset training or fine-tuning required.

Installation

pip install timee-ts

Requirements: Python ≥ 3.10, PyTorch ≥ 2.0.

Quickstart

from timee import TimeeClassifier
import numpy as np

clf = TimeeClassifier.from_pretrained()  # downloads from HuggingFace on first use

# X: (n_samples, n_channels, seq_len) float32
X_train = np.random.randn(20, 1, 256).astype(np.float32)
y_train = np.array([0, 1] * 10)
X_test  = np.random.randn(5, 1, 256).astype(np.float32)

predictions, probabilities = clf.predict(X_train, y_train, X_test)

Labels can be any type (int, str, etc.). Datasets with more than 10 classes are handled automatically via one-vs-rest.

API

TimeeClassifier.from_pretrained(path, device=None, use_ensemble=True)

Loads a checkpoint from a directory containing model.safetensors.

Parameter Default Description
path "liamsbhoo/timee" Local directory or HuggingFace Hub repo ID.
device auto "cuda", "cpu", or torch.device. Defaults to CUDA > MPS > CPU.
use_ensemble True 4-member preprocessing ensemble (interpolate×{256,512} × {raw, diff}). Set False for faster single-pass inference.

clf.predict(X_train, y_train, X_test)

Returns (predictions, probabilities):

  • predictions: (n_test,), same type as y_train
  • probabilities: (n_test, n_classes), rows sum to 1

Multivariate Support (beta)

Note: TIMEE is trained and evaluated as a univariate classifier — multivariate is not its focus (yet).

As mentioned in the paper, TIMEE supports multivariate input through two mechanisms:

  1. channel-independent: each channel is classified separately and the per-channel class probabilities are averaged.
  2. late-channel-mixing: channels are embedded separately before going through an attention pooling layer (acting as a mixer).

Mechanism (1) is already implemented in TimeeClassifier: pass (n_samples, n_channels, seq_len) input (use n_channels=1 for the univariate case) and it averages over channels automatically.

Mechanism (2) is implemented as TimeeMultivariateClassifier, which fuses channels via attention pooling and takes the same (n_samples, n_channels, seq_len) input.

from timee import TimeeMultivariateClassifier

clf = TimeeMultivariateClassifier.from_pretrained()
predictions, probabilities = clf.predict(X_train, y_train, X_test)

Citation

@misc{küken2026timeeendtoendtimeseries,
      title={TimEE: End-to-end Time Series Classification via In-Context Learning},
      author={Jaris Küken and Shi Bin Hoo and Martin Mráz and Frank Hutter and Lennart Purucker},
      year={2026},
      eprint={2607.07500},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2607.07500},
}

Download files

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

Source Distribution

timee_ts-0.1.1.tar.gz (477.8 kB view details)

Uploaded Source

Built Distribution

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

timee_ts-0.1.1-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file timee_ts-0.1.1.tar.gz.

File metadata

  • Download URL: timee_ts-0.1.1.tar.gz
  • Upload date:
  • Size: 477.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for timee_ts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ebce5c8c903f7098e521e430b4c1228bb091ebdd8b0858de691eff7a8773e7b9
MD5 70305cdceabaeb9597f61123d290cae1
BLAKE2b-256 0a5f92fe1be6c2dd9b330ed2402b5e753ed887454230976ce73833fbc672cd86

See more details on using hashes here.

Provenance

The following attestation bundles were made for timee_ts-0.1.1.tar.gz:

Publisher: publish.yml on automl/timee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file timee_ts-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: timee_ts-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for timee_ts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38f8ca288e9d6da07fca72899c17ffe09bc3415cbed011a7a3292da83b87b1f2
MD5 9b3dd27a787e2eee9dd23d864bbd4097
BLAKE2b-256 dbc63aee22261d05d81a26e6e471c355a978414ee8c9d64b7dd3586612790d06

See more details on using hashes here.

Provenance

The following attestation bundles were made for timee_ts-0.1.1-py3-none-any.whl:

Publisher: publish.yml on automl/timee

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page