Conversation
Integrate RLCD structure learning into HiddenCausal with causal-learn style API, docs, tests, and dependency declarations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds RLCD (Rank-based Latent Causal Discovery) to
causal-learnundercausallearn.search.HiddenCausal.RLCD.The implementation integrates the structure-learning portion of RLCD from scm-identify and exposes it through a causal-learn style API:
What Changed
causallearn/search/HiddenCausal/RLCD/.RLCD(data, ...) -> CausalGraphAPI, consistent with methods such as PC.Chi2RankTestfor sample-based rank testing.docs/source/search_methods_index/Hidden causal representation learning/.docs/source/getting_started.rstandsetup.pywith new dependencies:communitiesjoblibtests/TestRLCD.pywith a synthetic hidden-variable recovery test.API
The main public entry point is:
Optional parameters include:
The returned object is a
CausalGraph, wherecg.G.graph[j, i] = 1andcg.G.graph[i, j] = -1indicatei --> j;cg.G.graph[i, j] = cg.G.graph[j, i] = -1indicatesi --- j; andcg.G.graph[i, j] = cg.G.graph[j, i] = 1indicatesi <-> j.Additional RLCD metadata is attached to the returned object:
cg.stage1_cgcg.adjacencycg.all_varsDocumentation
The new RLCD docs include:
cg.draw_pydot_graph()GraphUtils.to_pydot(cg.G)data,ranktest_method,stage1_method,alpha_dict,maxk, andnode_names.CausalGraph.Testing
Added a test that constructs a simple linear Gaussian model with hidden variables:
Chi2RankTest.GraphUtils.to_pydot(cg.G).Test Plan
Both checks pass locally.