Add DGES algorithm and enhance GES with updated BIC score and colored graph visualization#256
Conversation
lokali
commented
Mar 25, 2026
- Add DGES (Deterministic GES): Algorithm 1 from Li et al. (NeurIPS 2024) for causal discovery in the presence of deterministic relations. Three-phase approach: MinDC detection, DC-aware GES, optional exact search.
- Add deterministic-aware BIC score (local_score_BIC_from_cov_deterministic) that handles zero residual variance gracefully.
- Add covariance-based BIC score (local_score_BIC_from_cov) for GES, enabling GES to run from precomputed covariance matrices.
- Add lambda_value parameter to GES for controlling BIC penalty strength.
- Add node_names parameter to GES for custom node labeling.
- Add GraphUtils.plot_graph() for rendering colored causal graphs with manual per-node colors or automatic category-based coloring.
- Add GraphUtils.get_category_colors() helper for category-to-color mapping.
- Update documentation: DGES page, enhanced GES page, Datasets page, Graph Visualization page under Utilities.
|
Thank you so much @lokali for the efforts. Wonderful job in 1) resolving previous issues on lambda penalty term, 2) speedup >5x, and many more! I have met with Loka offline and checked the code part; it looks good to me, except for a quick question above on the kernel based score. @kunwuz could you please then review the readthedocs html part, and see if they render properly? If so I think this pr is ready to be merged. Loka thank you again! |
|
Thanks for the PR and review! The doc part is a bit different--we previously only edited/added rst files like docs/source/search_methods_index/Score-based causal discovery methods/GES.rst, and building html is done online via readthedocs. Could you please remove the html files here, and open a new pr with new rst files similar to the one pointed above? |
Code changes: - Add DGES (Deterministic GES): Algorithm 1 from Li et al. (NeurIPS 2024) for causal discovery in the presence of deterministic relations. - Add deterministic-aware BIC score (local_score_BIC_from_cov_deterministic). - Add covariance-based BIC score (local_score_BIC_from_cov) for GES. - Add lambda_value top-level parameter to GES for BIC penalty control. - Add node_names parameter to GES for custom node labeling. - Add GraphUtils.plot_graph() for colored graph visualization. - Add GraphUtils.get_category_colors() for category-to-color mapping. - Set default BIC lambda_value=0.5 (standard BIC: 0.5*log(n) per param). - Fix gpr_multi_new gradient: only optimize noise variance per paper (Huang et al., 2018, Sec 4.2.2: kernel widths are fixed). Documentation (RST for ReadTheDocs): - Add DGES.rst under Score-based causal discovery methods. - Add GraphVisualization.rst under Utilities. - Update index.rst files to include new pages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eb7625e to
5d5e849
Compare
The score functions were unified to return higher-is-better scores, but GST (used by GRaSP and BOSS) was negating the scores internally, causing these algorithms to produce near-complete graphs. Remove the negation so GST correctly uses the scores directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>