Capabilities

Production & architectures

The plumbing that gets a model into production: save/load that keeps calibration intact, export and serving, reproducibility and logging hooks — and the architectures you can pick from.

← All features

Production & ops

The plumbing to ship it: persist, export, serve, log, reproduce.

Persistence

Save and load the model with its scalers and conformal calibration intact.

save() / load() round-trip the weights, the fitted scalers, and the conformal calibration together, so a reloaded model forecasts and calibrates exactly as before. Checkpoints record the library version and refuse incompatible ones.

model.save('m.pt'); APDTFlowForecaster.load('m.pt')

TorchScript export

Export grid-forecast inference to TorchScript.

Trace the grid-forecast path into a TorchScript module for lean, Python-optional serving. (predict_at and predict_when stay in the Python API.)

model.export_torchscript('model.pt')

FastAPI serving

Serve forecasts over HTTP with a small FastAPI app.

A small, ready-to-adapt FastAPI app that exposes forecast endpoints over HTTP — a starting point for your own service.

uvicorn serve_api:app see example: serve_api.py →

Reproducible runs

One call for deterministic seeding across NumPy and PyTorch.

set_seed() seeds Python, NumPy and PyTorch and turns on deterministic mode, so the same inputs give the same model.

from apdtflow import set_seed; set_seed(0)

Experiment logging

Stream epoch metrics to MLflow or Weights & Biases.

fit() accepts a log_callback(epoch, metrics) hook that drops straight into MLflow or Weights & Biases for live training curves.

model.fit(df, log_callback=lambda e, m: mlflow.log_metrics(m, step=e))

sklearn-compatible

get_params / set_params for pipelines and hyperparameter search.

get_params / set_params follow the scikit-learn estimator contract, so APDTFlow slots into Pipelines and hyperparameter search.

model.get_params(); model.set_params(num_epochs=30)

Typed

Ships a py.typed marker for full static type checking.

A py.typed marker ships inline type information for editors and type checkers.

import apdtflow # PEP 561 typed

Command line

Train and forecast straight from the terminal.

apdtflow train and apdtflow infer cover CSV-in / forecast-out workflows without writing any Python.

apdtflow train --csv_file data.csv --value_col y

Architectures

Neural ODE is the default and powers the continuous-time and uncertainty features; Transformer and TCN are lean grid forecasters.

Neural ODE

Continuous latent dynamics — the engine behind predict_at and predict_when. (default)

The default. It models the latent dynamics as a continuous ODE — the foundation for predict_at and predict_when — and supports conformal intervals, exogenous, categorical and multivariate inputs.

APDTFlowForecaster(model_type='apdtflow')

Transformer

Attention-based grid forecaster.

An attention-based sequence model for straightforward grid forecasts.

APDTFlowForecaster(model_type='transformer')

TCN

Temporal convolutional grid forecaster.

A temporal convolutional network for straightforward grid forecasts.

APDTFlowForecaster(model_type='tcn')
← Previous Evaluation & monitoring