LiNGAM in Python

LiNGAM in Python

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

Introduction

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.

Installation environment

OS: Mojave (version; 10.14.6) Python: 3.7.6 JupyterLab: 1.2.6

procedure

  1. Package installation
  2. Graphviz maintenance
  3. Operation check

Package installation

Install in Terminal below.

$ pip install lingam

Graphviz maintenance

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

Operation check

This time I will use the tutorial.

Download files from GitHub

Drop it locally from "Clone or Download" on the following site. https://github.com/cdt15/lingam

Start Jupyter Lab

Any method was used, but it was executed as follows.

Below in Terminal.

$ jupyter lab

Upload from "examples" to texto

From "examples" in the dropped file, use "utils.ipynb" this time. So upload this on JupyterLab.

Try to move

Basically, run the read notebook for each cell and check the operation.

reference

--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

LiNGAM in Python
Quadtree in Python --2
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Disassemble in Python
Reflection in Python
Constant in python
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Hashable in python
DirectLiNGAM in Python
Flatten in python
flatten in python
Sorted list in Python
Clustering text in Python
Daily AtCoder # 2 in Python
Implement Enigma in python
Daily AtCoder # 6 in Python
Daily AtCoder # 18 in Python
Edit fonts in Python
Singleton pattern in Python
File operations in Python
Read DXF in python
Daily AtCoder # 53 in Python
Key input in Python
Use config.ini in Python
Daily AtCoder # 33 in Python
Solve ABC168D in Python
Logistic distribution in Python
LU decomposition in Python
One liner in Python
Simple gRPC in Python
Daily AtCoder # 24 in Python
Solve ABC167-D in Python
Daily AtCoder # 37 in Python