gasperpetelin/TSCGlue

0

stars

184

commits

Python

primary language

Aug 13, 2026

updated

README

TSCGlueClassifier

Automatic Time Series Classification library built on top of aeon and scikit-learn.

Benchmark

Critical difference diagram evaluated on 112 univariate UCR datasets:

Critical difference diagram

Installation

# Base install (no PyTorch)
pip install tscglue

# Generic PyTorch (pip resolves version)
pip install "tscglue[torch]"

# CPU PyTorch (via uv)
uv pip install "tscglue[cpu]"

# CUDA 12.4 PyTorch (via uv)
uv pip install "tscglue[cu124]"

If you already have PyTorch installed, just install the base package — it won't reinstall torch.

Quick Start

from tscglue import utils
from tscglue.models import TSCGlueClassifier
from sklearn.metrics import accuracy_score

# Load a time series classification dataset
X_train, y_train, X_test, y_test = utils.load_dataset("ArrowHead")

# Create and train the model
model = TSCGlueClassifier(
    random_state=270,
    k_folds=10,
    n_jobs=-1
)
model.fit(X_train, y_train)

# Make predictions
y_pred = model.predict(X_test)
accuracy = accuracy_score(y_test, y_pred)
print(f"Accuracy: {accuracy:.4f}")

TSCGlueV2 — preset composition

Representations

Which representation is included in which preset.

RepresentationFamilylowmediumhigh
multirocket + hydraconvolution
quantinterval quantile
rstsf-randominterval
rdstshapelet
weaseldictionary
fm (mantis + chronos2)foundation
drcifinterval
tsfreshfeature-based

Base models (level 0)

low = medium minus weasel and fm — identical model names and heads on the four shared representations. high = same six representations, but two heads each.

Representationlowmediumhigh
multirocket + hydrabestk-ridgecvbestk-ridgecvbestk-ridgecv, et
quantetetridgecv, et
rstsf-randometetridgecv, et
rdstridgecvridgecvridgecv, et
weaselbestk-ridgecvbestk-ridgecv, et
fmridgecvridgecv, et
total models4612
heads per representation112

Stacking models (level 1)

Trained on the level-0 models' OOF probabilities. medium and high train all five. low trains exactly one, chosen by eval_metric.

Stacking modellowmediumhigh
ridgecv✅ *✅ **✅ **
logisticcv
et✅ *
nn
rf
total stackers155

* low trains only one of these two, chosen by eval_metric: ridgecv for accuracy / f1, et for log_loss / roc_auc — the existing TSCGlueClassifier mapping (ridge wins accuracy, ExtraTrees wins log-loss and AUC, per the critical-difference study). f1 is not in that mapping yet and needs a decision (ridgecv proposed, matching accuracy).

** ridgecv is trained and Brier-scored, but excluded from the stack-mean — its decision-function pseudo-probabilities are uncalibrated and would skew the average. It is therefore only actually served if Brier selection picks it over the mean.

Level-2 head

What combines the level-1 stackers into the served prediction. One head per preset.

Level-2 headlowmediumhigh
probability-stack-mean
probability-et-l2-all

Contributors

gasperpetelin

177 commits

lejkosir

7 commits

gasperpetelin/TSCGlue

0

stars

184

commits

Python

primary language

Aug 13, 2026

updated

README

TSCGlueClassifier

Automatic Time Series Classification library built on top of aeon and scikit-learn.

Benchmark

Critical difference diagram evaluated on 112 univariate UCR datasets:

Critical difference diagram

Installation

# Base install (no PyTorch)
pip install tscglue

# Generic PyTorch (pip resolves version)
pip install "tscglue[torch]"

# CPU PyTorch (via uv)
uv pip install "tscglue[cpu]"

# CUDA 12.4 PyTorch (via uv)
uv pip install "tscglue[cu124]"

If you already have PyTorch installed, just install the base package — it won't reinstall torch.

Quick Start

from tscglue import utils
from tscglue.models import TSCGlueClassifier
from sklearn.metrics import accuracy_score

# Load a time series classification dataset
X_train, y_train, X_test, y_test = utils.load_dataset("ArrowHead")

# Create and train the model
model = TSCGlueClassifier(
    random_state=270,
    k_folds=10,
    n_jobs=-1
)
model.fit(X_train, y_train)

# Make predictions
y_pred = model.predict(X_test)
accuracy = accuracy_score(y_test, y_pred)
print(f"Accuracy: {accuracy:.4f}")

TSCGlueV2 — preset composition

Representations

Which representation is included in which preset.

RepresentationFamilylowmediumhigh
multirocket + hydraconvolution
quantinterval quantile
rstsf-randominterval
rdstshapelet
weaseldictionary
fm (mantis + chronos2)foundation
drcifinterval
tsfreshfeature-based

Base models (level 0)

low = medium minus weasel and fm — identical model names and heads on the four shared representations. high = same six representations, but two heads each.

Representationlowmediumhigh
multirocket + hydrabestk-ridgecvbestk-ridgecvbestk-ridgecv, et
quantetetridgecv, et
rstsf-randometetridgecv, et
rdstridgecvridgecvridgecv, et
weaselbestk-ridgecvbestk-ridgecv, et
fmridgecvridgecv, et
total models4612
heads per representation112

Stacking models (level 1)

Trained on the level-0 models' OOF probabilities. medium and high train all five. low trains exactly one, chosen by eval_metric.

Stacking modellowmediumhigh
ridgecv✅ *✅ **✅ **
logisticcv
et✅ *
nn
rf
total stackers155

* low trains only one of these two, chosen by eval_metric: ridgecv for accuracy / f1, et for log_loss / roc_auc — the existing TSCGlueClassifier mapping (ridge wins accuracy, ExtraTrees wins log-loss and AUC, per the critical-difference study). f1 is not in that mapping yet and needs a decision (ridgecv proposed, matching accuracy).

** ridgecv is trained and Brier-scored, but excluded from the stack-mean — its decision-function pseudo-probabilities are uncalibrated and would skew the average. It is therefore only actually served if Brier selection picks it over the mean.

Level-2 head

What combines the level-1 stackers into the served prediction. One head per preset.

Level-2 headlowmediumhigh
probability-stack-mean
probability-et-l2-all

Contributors

gasperpetelin

177 commits

lejkosir

7 commits

Languages

Python

80.7%

Jupyter Notebook

18.6%