Generalized Independence Noise (GIN) condition-based method

Algorithm Introduction

Learning the structure of Linear, Non-Gaussian LAtent variable Model (LiNLAM) based the GIN 1 condition.

Usage

from causallearn.search.HiddenCausal.GIN.GIN import GIN
G, K = GIN(data)

# Visualization using pydot
from causallearn.utils.GraphUtils import GraphUtils
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import io

pyd = GraphUtils.to_pydot(G)
tmp_png = pyd.create_png(f="png")
fp = io.BytesIO(tmp_png)
img = mpimg.imread(fp, format='png')
plt.axis('off')
plt.imshow(img)
plt.show()

Visualization using pydot is recommended (usage example). If specific label names are needed, please refer to this usage example (e.g., GraphUtils.to_pydot(G, labels=[“A”, “B”, “C”]).

Parameters

data: numpy.ndarray, shape (n_samples, n_features). Data, where n_samples is the number of samples and n_features is the number of features.

Returns

G: GeneralGraph. Causal graph.

K: list. Causal Order.

1

Xie, F., Cai, R., Huang, B., Glymour, C., Hao, Z., & Zhang, K. (2020, January). Generalized Independent Noise Condition for Estimating Latent Variable Causal Graphs. In NeurIPS.