Skip to content

C-Naoki/AdaKoop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AdaKoop: Efficient Modeling of Nonlinear Dynamics from Nonstationary Data Streams with Koopman Operator Regression

Python 3.12 Pyenv uv Ruff

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.

Usage

  1. Clone this repository.

    git clone https://github.com/C-Naoki/AdaKoop.git
  2. 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.txt created based on pyproject.toml.

    Specifically, the above command performs the following steps:

    1. if necessary, install Python 3.12.11 using pyenv, and then switch to this version.
    2. create a virtual environment based on Python 3.12.11
    3. install packages in pyproject.toml.
    4. attach the path file (i.e., *.pth) in the site-packages/ for extending module search path.

    Please check the Makefile for more details.

  3. Prepare the datasets.

    make prepare
    • This command generates the datasets and saves them in the data/dysts/ directory.
  4. 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 -n option as shown below (using nohup).

    bash bin/demo.sh -n
    • The execution log is saved in nohup/ directory.

Minimal Example

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]

Parameters

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.

Datasets

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.

Citation

If you use this code for your research, please consider citing our paper.

About

[KDD2026] AdaKoop: Efficient Modeling of Nonlinear Dynamics from Nonstationary Data Streams with Koopman Operator Regression (to appear).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors