Skip to content

Loading artifacts

Functions that read the artifacts of a run back: series, pools, generator weights, records, labels, predictions and fitted models.

marathonts.bench.load

Load anything back from the artifacts: generators and downstream models with their weights (ready to sample / generate / predict), pools, series, predictions, metrics.

from marathonts.bench.config import Config
from marathonts.bench import load
cfg = Config()
gen = load.load_generator(cfg, "ett", "tsgm_vae", seed=0)          # fitted VAE, no training
windows = gen.sample(100, load.gen_context(cfg, "ett", "tsgm_vae", 0))
m = load.load_model(cfg, "ett", "vae_zseries", 0, task="clf_up_h24_q90", model="linear", regime="S")
X, y, _ = load.task_xy(cfg, "ett", "clf_up_h24_q90", split="oot")
p = m.predict(X)

load_synth

load_synth(cfg: Config, ds: str, method: str, seed: int, check: bool = True) -> Synth | None

The stored series, or None if missing, truncated or (check) made with other settings; check=False reads the series of a frozen method (Config.frozen_methods) as it is.

load_generator

load_generator(cfg: Config, ds: str, gen: str, seed: int)

A fitted pool or long generator restored from the artifacts — the weights this config uses for the seed: a pool generator's own (seed<k>) or shared replica (replica<r>), Diffusion-TS per seed or the one model per dataset (seedshared). Weights made with other training settings (record unit_fp) are refused.

model_keys

model_keys(cfg: Config, ds: str, method: str, seed: int) -> pd.DataFrame

Which fitted models are stored for a unit: task, model, regime.

load_model

load_model(cfg: Config, ds: str, method: str, seed: int, task: str, model: str, regime: str)

A fitted downstream model restored from artifacts/utility/.../models.parquet.

task_xy

task_xy(cfg: Config, ds: str, task: str, split: str = 'oot')

Real features / labels of a split for a task (thresholds from train) — to feed loaded models.

load_predictions

load_predictions(cfg: Config, ds: str, method: str, seed: int, with_scores: bool = False) -> pd.DataFrame

Every test prediction of a unit; with_scores=True joins the labels and the row-level score (losses divided by the seasonal-naive MAE of train, as in metrics.parquet — comparable across datasets).