py-why / py-why/causal-learn

GeneralGraph class needs export to adj matrix

Open
#140 8 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 there,
I really hope you could add an additional method to produce the adjacency matrix.
Here's a use case very common in GCastle:

from castle.metrics import MetricsDAG
from castle.common import GraphDAG
from causallearn.search.ConstraintBased.PC import pc
import matplotlib.pyplot as plt

cg = pc(dataset,alpha=0.001,indep_test='mv_fisherz',mvpc=True,stable=True)

GraphDAG(est_dag=cg.G.adj_matrix(),true_dag=true_matrix)
plt.show()

We need a method for example adj_matrix() that returns a numpy adjacency matrix.
That way we can perform the metrics calculations.

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 the GeneralGraph class and inspect its existing graph accessors and matrix representation. Use the MetricsDAG and GraphDAG example as the integration context; done means an adj_matrix() method returns a NumPy adjacency matrix suitable for GraphDAG metrics calculations.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
machine-learning
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.