LiM

class lingam.LiM(lambda1=0.1, loss_type='mixed', max_iter=150, h_tol=1e-08, rho_max=1e+16, w_threshold=0.1)[source]

Implementation of LiM Algorithm [1]

References

[1]Zeng Y, Shimizu S, Matsui H, et al. Causal discovery for linear mixed data[C]//Conference on Causal Learning and Rea- soning. PMLR, 2022: 994-1009.
__init__(lambda1=0.1, loss_type='mixed', max_iter=150, h_tol=1e-08, rho_max=1e+16, w_threshold=0.1)[source]

Construct a LiM model.

Parameters:
  • lambda1 (float, optional (default=0.1)) – L1 penalty parameter.
  • loss_type (str, (default='mixed')) – Type of distribution of the noise.
  • max_iter (int, (default=150)) – Maximum number of dual ascent steps.
  • h_tol (float, (default=1e-8)) – Tolerance parameter of the acyclicity constraint.
  • rho_max (float, (default=1e+16)) – Maximum value of the regularization parameter rho.
  • w_threshold (float (default=0.1)) – Drop edge if the weight btw. variables is less than w_threshold.
adjacency_matrix_

Estimated adjacency matrix between mixed variables.

Returns:adjacency_matrix_ – The adjacency matrix of variables, where n_features is the number of observed variables.
Return type:array-like, shape (n_features, n_features)
fit(X, dis_con)[source]

Fit the model to X with mixed data.

Parameters:
  • X (array-like, shape (n_samples, n_features)) – Training data, where n_samples is the number of samples and n_features is the number of observed variables.
  • dis_con (array-like, shape (1, n_features)) – Indicators of discrete or continuous variables, where “1” indicates a continuous variable, while “0” a discrete variable.
Returns:

self – Returns the instance of self.

Return type:

object