otlingam.models.GreedyOTLiNGAM¶
- class GreedyOTLiNGAM(fit_intercept=True)[source]¶
Greedy score-based causal discovery by sequential source removal.
This estimator repeatedly selects the most non-Gaussian standardized residual as the next source in the causal order. It then removes the source’s linear effect from every remaining variable. Once the ordering is recovered, edge weights are estimated using adaptive lasso regression.
- Data preprocessing settings:
fit_intercept: Whether to center the data before fitting. Centering also enables estimation of an intercept for each variable.
- Variables:
fit_intercept (bool) – Whether to center the data before fitting.
_causal_order (list[np.integer] | None) – Internal causal ordering. None before fitting.
_adjacency_matrix (np.ndarray | None) – Internal weighted adjacency matrix. None before fitting.
causal_order (list[np.integer]) – Learned causal order from source to sink.
adjacency_matrix (np.ndarray) – Learned weighted adjacency matrix.
intercept (np.ndarray) – Intercepts of the regression models. Available only when fit_intercept is True.
score (float) – Sum of the selected squared Wasserstein scores.
- Parameters:
fit_intercept (bool)
Examples
>>> from otlingam import GreedyOTLiNGAM >>> model = GreedyOTLiNGAM(fit_intercept=True) >>> model.fit(X) >>> model.causal_order_
- __init__(fit_intercept=True)[source]¶
Initializes GreedyOTLiNGAM.
- Parameters:
fit_intercept (bool, optional) – Whether to center the data. Defaults to True.