py-why / py-why/causal-learn

Background knowledge not used correctly?

Open
#171 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
274
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm trying to provide a background graph to reduce the number of edges that I have to check when running PC. I'm doing this by setting forbidden edges in my BackgroundKnowledge object.

However, based on the code here: https://github.com/py-why/causal-learn/blob/main/causallearn/utils/PCUtils/SkeletonDiscovery.py#L100

it looks like the conditional independence test is being tested even when the pair of nodes is marked as 'forbidden'. Is this correct? Shouldn't this be completely skipped?

Because of this I see that my runtime for the naive (no background) is the same as the runtime for when I give a background graph, even when I use the FastBackgroundKnowledge object that was previously discussed (https://github.com/py-why/causal-learn/issues/142).

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at causallearn/utils/PCUtils/SkeletonDiscovery.py around line 100 and trace how forbidden edges from BackgroundKnowledge are handled before conditional independence tests run. Compare the behavior with FastBackgroundKnowledge discussed in issue #142, then confirm whether forbidden pairs should avoid testing and document the resulting runtime behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.