Continuous-time forecasting · Neural ODEs

know WHEN
it will happen

Forecasting tools tell you what the value will be. APDTFlow models time as continuous, so it also answers the question operations teams actually ask: when will it cross the line? — with a calibrated window on the time itself.

$ pip install apdtflow
46k+
PyPI downloads
44+
GitHub stars
MIT
License
v0.5.0
Latest release
predict_when calibrated 90% window
now threshold act_by eta

One trained model

Three questions, one API

The same continuous-time model answers all three — from the next k values to the exact moment a threshold is crossed.

What are the next k values?

model.predict()

Classic grid forecast with optional conformal intervals.

What is the value at any moment — 14:37, in 3.6 days, beyond the trained horizon?

model.predict_at(timestamps)

Query a continuous-time decoder at arbitrary real-valued times.

the differentiator

When will the value cross a threshold, with uncertainty on the time itself?

model.predict_when(threshold)

A calibrated 90% window on the crossing time, plus an act_by edge to schedule against.

See it work

Real data, real plots

Every figure below is produced by a committed script on real NASA and public datasets. Open the demos page for the code.

The part most libraries hide

We publish the numbers our scripts reproduce — including where we lose

Event-timing audits on real held-out hardware. Lower is better (timing MAE in cycles). In these single-seed June runs APDTFlow won the battery and FD001 audits and lost to a linear baseline on FD002. A November 10-seed re-run of the battery audit put it slightly behind linear on average (mean 10.7 vs 9.7; ahead on 2 of 10 seeds): shown here, not buried.

Audit (real data, held-out units) APDTFlow Linear extrap. Persistence
Battery end-of-life 3 cells, leave-one-battery-out; June, one seed (10-seed re-run: mean 10.7, behind linear) 8.3 9.7 15.4
Turbofan FD001 40 unseen engines, 0.6% false alarms 8.3 8.7 11.5
Turbofan FD002 110 unseen engines, 6 operating regimes, 0.0% false alarms 9.2 8.1 11.3
0 false alarms across 2,638 no-crossing windows coverage 96 / 40 / 54 vs a 90% target battery re-run, 10 seeds: mean 10.7 vs linear 9.7 a script in experiments/ for every number
Trust panel showing the point-estimate bias and how to schedule around it

The trust panel reports its own miss

On cross-unit transfer the windows measured under their 90% target, and for distant events the point estimate saturates toward mid-horizon. That is why the operational rule exists:

schedule by act_by (the window's earliest edge), never by the point estimate.

Full benchmarks and reproduce commands →

Source of truth, with per-seed tables: docs/experiment_results.md. Windows are calibrated on the training windows, the library default; holding the most recent windows out instead is an option, and measured worse on these audits (docs/METHODOLOGY.md).

Capabilities, not accuracy

What each tool family offers

For pure grid accuracy on regular data, tuned deep models or foundation models may be stronger. APDTFlow's value is what grid models cannot do at all.

Capability APDTFlowGrid DL libsFoundation models
Grid forecasts (predict) ✓✓✓
Calibrated conformal intervals ✓~~
Forecast at arbitrary real-valued times (predict_at) ✓✕✕
Event timing with calibrated windows (predict_when) ✓✕✕
Fleet-level act-by scheduling ✓✕✕
Zero-shot (no training) ✕✕✓

Honesty as a feature

When not to use APDTFlow

The forecasting library that tells you its own limits. If your problem is in this list, reach for something else — and we say which.

  • Stock prices / crypto: random-walk regime; nothing beats naive, including us.
  • Event timing on noise-driven crossings: no model has skill there; expect wide, honest windows.
  • Irregularly-sampled / heavily missing data: ODE-RNN encoders lost to simple imputation in our tests.
  • Very short series (< ~500 points): use ETS / ARIMA.