AdaKoop: Efficient Modeling of Nonlinear Dynamics from Nonstationary Data Streams with Koopman Operator Regression
This repository contains the implementation of the KDD 2026 paper, "AdaKoop: Efficient Modeling of Nonlinear Dynamics from Nonstationary Data Streams with Koopman Operator Regression," by Naoki Chihara, Ren Fujiwara, Yasuko Matsubara, Yasushi Sakurai.
Figure 1. Overview of AdaKoop.
-
Clone this repository.
git clone https://github.com/C-Naoki/AdaKoop.git
-
Construct a virtual environment and install the required packages.
make install
- Note that it requires to pyenv and uv.
- If you prefer not to use them, you can also use
requirements.txtcreated based on pyproject.toml.
Specifically, the above command performs the following steps:
- if necessary, install Python 3.12.11 using pyenv, and then switch to this version.
- create a virtual environment based on Python 3.12.11
- install packages in
pyproject.toml. - attach the path file (i.e.,
*.pth) in thesite-packages/for extending module search path.
Please check the
Makefilefor more details. -
Prepare the datasets.
make prepare
- This command generates the datasets and saves them in the
data/dysts/directory.
- This command generates the datasets and saves them in the
-
Run quick demos of AdaKoop
bash bin/demo.sh
If you want the command to continue running after logging out, you prepare
nohup/directory and use-noption as shown below (using nohup).bash bin/demo.sh -n
- The execution log is saved in
nohup/directory.
- The execution log is saved in
import numpy as np
from src.models.adakoop import AdaKoop
# Build the model and set parameters.
model = AdaKoop(verbose=False)
model.init_params(d=d, lcurr=lcurr)
# Initialization.
# - X_train, X_test : np.ndarray, shape (n, d)
# - X_test is time series immediately after X_train.
model.initialize(X_train)
model.set_initial_model(X_train[-lcurr:])
# Online forecasting.
pred = np.full_like(X_test, np.nan)
for tc in range(len(X_test) - lstep):
x_new = X_test[tc]
model.model_selection(x_new)
model.update(x_new)
forecast, _, _ = model.forecast(lstep=lstep)
pred[tc + lstep] = forecast[-1]The main parameters of AdaKoop are summarized in the table below.
| Argument | Default | Description |
|---|---|---|
lcurr |
Required | Current window length. |
lstep |
Required | Forecasting horizon. |
nu |
1e-3 |
Threshold for basis orthogonalization. |
gamma |
3e-3 |
Online forgetting factor. |
kernel_type |
rbf |
Kernel used for window comparison and dictionary features. |
lambda_A |
1e-6 |
Ridge regularization strength for the transition matrix A. |
em_iters |
3 |
Maximum number of EM refinement iterations. |
em_tol |
1e-6 |
Convergence tolerance for EM refinement. |
m_max |
100 |
Maximum dictionary size. |
chi2_p |
0.99 |
Chi-square quantile used to compute the innovation-distance threshold. |
We used the dysts benchmark datasets for evaluating of our proposed method. This benchmark offers various types of chaotic dynamical systems spanning diverse fields, including astrophysics, climatology, and biochemistry.
If you use this code for your research, please consider citing our paper.