Welcome to the repository for causal discovery deliverable 3.2 of CoDiet(https://www.codiet.eu/)! This codebase encompasses notebooks and test results associated with each figure in the deliverable.
- Generate Data: Use the
IIDSimulation
function inGenerate Data.py
to create artificial true causal graphs and observation data. - Learn Structure: Uncover the causal structure beneath the observation data.
- Visualize Comparison: Generate heat maps to compare estimated and true graphs.
- Calculate Metrics: Assess the performance metrics.
- Demonstrate in Heatmap: Illustrate results in a heatmap for multiple datasets.
- Synthetic Data: Utilize the
Ancpop_Synthetic
class to generate custom datasets. - Real-world Data: Employ the
Ancpop_Real
class inAncpop_Real.py
to test real data from the./Real data
folder. Alternatively, use generated data in./Synthetic data
. - Experiments: Experiment scripts for proposed methods and baselines are available in Jupyter notebooks named "Methods_withdevice.ipynb".
- Results: Access all results and figures mentioned in the paper from the
./result
folder. Repeat the results using "ANCPOP_test.ipynb".
- ANCPOP_test.ipynb: Execute this notebook for all experiments on synthetic and real-world data using the ANM_NCPOP approach. Upload datasets and the notebook to Colab for seamless execution.
To run experiments locally, ensure you have the following dependencies installed:
- Python (>= 3.6, <= 3.9)
- tqdm (>= 4.48.2)
- NumPy (>= 1.19.1)
- Pandas (>= 0.22.0)
- SciPy (>= 1.7.3)
- scikit-learn (>= 0.21.1)
- Matplotlib (>= 2.1.2)
- NetworkX (>= 2.5)
- PyTorch (>= 1.9.0)
- ncpol2sdpa 1.12.2 Documentation
- MOSEK (>= 9.3) MOSEK
- gcastle (>= 1.0.3)
# Execute the following commands to run the notebook directly in Colab. Ensure your MOSEK license file is in one of these locations:
#
# /content/mosek.lic or /root/mosek/mosek.lic
#
# inside this notebook's internal filesystem.
# Install MOSEK and ncpol2sdpa if not already installed
pip install mosek
pip install ncpol2sdpa
pip install gcastle==1.0.3