Skip to main content

CausalNN package is the implementation of the TS-CausalNN causal discovery method for time series data.

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

causalnn-0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

causalnn-0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file causalnn-0.1.tar.gz.

File metadata

  • Download URL: causalnn-0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for causalnn-0.1.tar.gz
Algorithm Hash digest
SHA256 862e14950d79fef3d1ec1f697b8ae15d2cec818ea1e0e1ca3561112e41adeec4
MD5 9a53260f093693437fb82aa970e161f9
BLAKE2b-256 235cd931688b04d3db26fe093b79c4c1792731476092df5254ec00f334fdd659

See more details on using hashes here.

File details

Details for the file causalnn-0.1-py3-none-any.whl.

File metadata

  • Download URL: causalnn-0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for causalnn-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3728fb52b9b4cf304649c6675d0d226580762783fc8ba8804f744aba45c72d2
MD5 d5573b8683bc4bbdb44eeb91be30c89c
BLAKE2b-256 501f24c98fbaf5ce0418d9160b85227e4e20e64df18b5ceb60fce85bebfbca37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page