A note on how to use LiNGAM in Python for one of the models used in statistical causal search (for myself). This time, I used the packaged one.
07May'20: Written
Currently, LiNGAM used in the causal search approach is implemented in R and Python.
R and / or Python for various LiNGAM models https://sites.google.com/site/sshimizu06/lingam
This time, we will check the operation of those using Python.
OS: Mojave (version; 10.14.6) Python: 3.7.6 JupyterLab: 1.2.6
Install in Terminal below.
$ pip install lingam
Even if I try to start JupyterLab and execute it as it is, an error occurs when drawing the causal graph. To avoid that, uninstall Graphviz used for drawing, and then reinstall it with python-. This makes it possible to draw on Jupyter Lab.
Below in Terminal.
$ conda remove graphviz
$ conda install python-graphviz
This time I will use the tutorial.
Drop it locally from "Clone or Download" on the following site. https://github.com/cdt15/lingam
Any method was used, but it was executed as follows.
Below in Terminal.
$ jupyter lab
From "examples" in the dropped file, use "utils.ipynb" this time. So upload this on JupyterLab.
Basically, run the read notebook for each cell and check the operation.
--LiNGAM's GitHub https://github.com/cdt15/lingam --Tutrial and API reference in LiNGAM's Python package https://lingam.readthedocs.io/en/latest/index.html --LiNGAM project site https://sites.google.com/site/sshimizu06/lingam
Recommended Posts