This is an official implementation of ModePlait. We focus on causal relationships that evolve over time in data streams and refer such relationships as "time-evolving causalities." We presented ModePlait, which aims to discover time-evolving causalities in multivariate co-evolving data streams, and forecast future values in a stream fashion simultaneously. The overview of our proposed model is following:
- Python 3.9.15
- numpy == 1.23.5
- pandas == 1.5.3
- matplotlib == 3.8.2
- scikit-learn == 1.1.3
- scipy == 1.11.4
-
Clone this repository.
git clone https://github.com/C-Naoki/ModePlait.git
-
Construct a virtual environment and install the required packages.
make install
- However, you are required to pyenv and poetry for above command to work.
- If you prefer not to use
pyenv
orpoetry
, you can also userequirements.txt
created based on pyproject.toml.
Specifically, the above command performs the following steps:
- if necessary, install Python 3.9.15 using pyenv, and then switch to this version.
- tell poetry to use python 3.9.15.
- install packages in
pyproject.toml
. - attach the path file (i.e.,
*.pth
) in thesite-packages/
for extending module search path.
Please check the
Makefile
for more details. -
Run quick demos of ModePlait
sh bin/google.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).mkdir nohup sh bin/google.sh -n
- The execution log is saved in
nohup/
directory.
- The execution log is saved in
(Other than 1. covid19
, everything is placed in the folder ./data
)
We compared our algorithm with the following baselines for causal discovering, including CASPER, DARING, NoCurl, NOTEARS-MLP (NO-MLP), NOTEARS, LiNGAM, and GES. We also compared with TimesNet, PatchTST, DeepAR, OrbitMap, and ARIMA for forecasting.
We ran experiments on synthetic datasets with multiple temporal sequences to encompass various types of scenarios and ModePlait outperformed all competitors for every setting.
ModePlait achieved a high forecasting accuracy for every dataset, including synthetic and real-world datasets. ModePlait† is a limited version of our proposed method.