TS-CausalNN: Time-Series Causal Neural Network
TS-CausalNN is a lcausal discovery method for Non-linear Non-stationary Time Series Data. It is a deep learning technique to discover contemporaneous and lagged causal relations simultaneously. Our proposed architecture comprises (i) convolutional blocks comprising parallel custom causal layers, (ii) acyclicity constraint, and (iii) optimization techniques using the augmented Lagrangian approach.
Important Assumptions
Assumption 1 (Markov and Faithfulness): Assume Xi,i∈ {1,...,n}is Markov and faithful to the true/generated causal graph G.
Assumption 2 (Causal Sufficiency): We assume that there are no unobserved confounders in the data generation process.
Assumption 3 (Causal Consistency): We assume that time- lagged and instantaneous causal relations between the vari- ables are consistent through all time steps.
Assumption 4 (Acyclicity): This assumption states that there are no causal paths that begin and end at the same node.
Demo Code With Synthetic Data
from causalnn import train_causalnn_model
mat_weights, shd, accuracy, precision, recall, FDR, F1 = train_causalnn_model(data_type="synthetic")
print('SHD: {}, Accuracy: {}, Precision: {}, Recall: {}, FDR: {}, F1 Score: {}'.format(shd, accuracy, precision, recall, FDR,F1))
Dependencies
Python>=3.12
Tensorflow>=2.20.0
Tensorflow_probability>=0.24.0
Sklearn
Numpy
Pandas
Installation
pip install causalnn
Paper Reference
TS-CausalNN: Learning Temporal Causal Relations from Non-Linear Non-Stationary Time Series Data Authors: Omar Faruque (University of Maryland, Baltimore County, USA), Sahara Ali (University of North Texas, USA), Xue Zheng (Lawrence Livermore National Laboratory, USA), Jianwu Wang (University of Maryland, USA) 2025 IEEE International Conference on Data Mining Workshops (ICDMW) DOI 10.1109/ICDMW69685.2025.00043
Release files for causalnn 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| causalnn-0.1.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| causalnn-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 kB
Release files / causalnn-0.1.tar.gz
| Download URL | causalnn-0.1.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
862e14950d79fef3d1ec1f697b8ae15d2cec818ea1e0e1ca3561112e41adeec4
|
|
BLAKE2b-256 checksum How to use checksums |
235cd931688b04d3db26fe093b79c4c1792731476092df5254ec00f334fdd659
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / causalnn-0.1-py3-none-any.whl
| Download URL | causalnn-0.1-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3728fb52b9b4cf304649c6675d0d226580762783fc8ba8804f744aba45c72d2
|
|
BLAKE2b-256 checksum How to use checksums |
501f24c98fbaf5ce0418d9160b85227e4e20e64df18b5ceb60fce85bebfbca37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|