otlingam.models.ExhaustiveOTLiNGAM¶
- class ExhaustiveOTLiNGAM(fit_intercept=True)[source]¶
Exhaustive score-based causal discovery via subset dynamic programming.
This estimator learns a directed acyclic graph by finding the causal ordering that maximizes a squared Wasserstein distance-based score. For each candidate sink, all preceding variables in the ordering are used as its parent set.
The optimal ordering is found exhaustively using subset dynamic programming. Regression residuals are standardized and compared with standard normal quantiles to compute the score. 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) – Squared Wasserstein distance-based score of the learned DAG.
- Parameters:
fit_intercept (bool)
Examples
>>> from otlingam import ExhaustiveOTLiNGAM >>> model = ExhaustiveOTLiNGAM(fit_intercept=True) >>> model.fit(X) >>> model.causal_order_
- __init__(fit_intercept=True)[source]¶
Initializes ExhaustiveOTLiNGAM.
- Parameters:
fit_intercept (bool, optional) – Whether to center the data. Defaults to True.