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 - 40k+
- PyPI downloads
- 44+
- GitHub stars
- MIT
- License
- v0.4.0
- Latest release
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.
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.
Fleet scheduling in one call
predict_when_fleet() turns real NASA jet engines (never seen in training) into a maintenance schedule sorted by act-by date. In this measured snapshot the calibrated windows covered 81% of the actual crossings.
predict_when_fleet(assets, threshold, direction)
A calibrated answer to "when?"
Windows are calibrated on crossing-time errors (time space), not value bands — the distinction that makes the coverage hold. The act_by edge lands before the true crossing.
predict_when(threshold=80, direction='above')
Forecast at any moment in time
One trained model, queried at arbitrary real-valued timestamps — fractional steps, between observations, even beyond the trained horizon — because the decoder integrates a continuous-time ODE.
predict_at(['2026-06-14 14:37', 3.6]) 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). APDTFlow wins the battery and FD001 audits outright, and loses to a linear baseline on FD002 — shown here, not buried.
| Audit (real data, held-out units) | APDTFlow | Linear extrap. | Persistence |
|---|---|---|---|
| Battery end-of-life 3 cells, leave-one-battery-out | 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 |
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: docs/experiment_results.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 | APDTFlow | Grid DL libs | Foundation 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.