GroupDirectLiNGAM
- class lingam.GroupDirectLiNGAM(prior_knowledge=None)[source]
Implementation of GroupDirectLiNGAM Algorithm [1]
References
- __init__(prior_knowledge=None)[source]
Construct a GroupDirectLiNGAM model.
- Parameters:
prior_knowledge (array-like, shape (n_groups, n_groups), optional (default=None)) –
Prior knowledge used for causal discovery, where
n_groupsis the number of groups.The elements of prior knowledge matrix are defined as follows [1]:
0: \(x_i\) does not have a directed path to \(x_j\)1: \(x_i\) has a directed path to \(x_j\)-1: No prior knowledge is available to know if either of the two cases above (0 or 1) is true.
- property adjacency_matrix_
Estimated adjacency matrix.
- Returns:
adjacency_matrix_ – The adjacency matrix B of fitted model, where n_features is the number of features.
- Return type:
array-like, shape (n_features, n_features)
- bootstrap(X, groups, n_sampling)[source]
Evaluate the statistical reliability of DAG based on the bootstrapping.
- Parameters:
X (array-like, shape (n_samples, n_features)) – Training data, where
n_samplesis the number of samples andn_featuresis the number of features.groups (array-like, shape (n_groups)) – The list of features for each group.
n_sampling (int) – Number of bootstrapping samples.
- Returns:
result – Returns the result of bootstrapping.
- Return type:
- property causal_order_
Estimated causal ordering.
- Returns:
causal_order_ – The causal order of fitted model, where n_groups is the number of groups.
- Return type:
array-like, shape (n_groups)
- fit(X, groups)[source]
Fit the model to X.
- Parameters:
X (array-like, shape (n_samples, n_features)) – Training data, where
n_samplesis the number of samples andn_featuresis the number of features.groups (array-like, shape (n_groups)) – The list of features for each group. where
n_groupsis the number of groups.
- Returns:
self – Returns the instance itself.
- Return type:
object