Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Causal adjacency matrix returned in case of insignificant node(s) #50

Closed
geogian opened this issue May 20, 2020 · 2 comments
Closed

Causal adjacency matrix returned in case of insignificant node(s) #50

geogian opened this issue May 20, 2020 · 2 comments
Assignees
Labels

Comments

@geogian
Copy link

geogian commented May 20, 2020

I am running multivariate analyses (both TE and MI) in a simulated dataset with 10 variables and known causal structure. I then retrieve the adjacency matrix of the estimated causal graph with results.get_adjacency_matrix (binary weights) and subsequently export it to networkx with io.export_networkx_graph. Then I transform it to a numpy matrix with nx.to_numpy_matrix.

I have found that, if a variable of the dataset is not deemed significant as a source or as a target, (i.e. if, as a node, it is disconnected from the graph the method returns), then it is not part of the graph visualization, and it is also not included (as a zero row & column) in the corresponding adjacency matrix.

This leads to a corresponding adjacency matrix of smaller dimension. In my example, using multivariate MI, one node is found insignificant, and the adjacency matrix is 9x9 (instead of 10x10 which is in line with the dimension of the original data).

When the causal ground truth of the dataset is known, it is of great interest to compare the estimated causal adjacency matrix with the ground truth adjacency matrix - and evaluate the performance of the method e.g. through binary classification metrics.

It is also important to be able to iterate the analysis and evaluate the performance of the method over an arbitrary number of such datasets. Due to the aforementioned potential discrepancy in dimensions between the two matrices used to evaluate the performance of the method, this task is hard to automate, as inconsistencies in matrix dimensions will break the evaluation.

Is there a way to always retrieve the full-dimension adjacency matrix with current idtxl tools?

@pwollstadt
Copy link
Owner

Hi @geogian, this is actually a problem, I have also encountered. This is quite easy to fix. I will put this on my todo list and work on it asap. Thanks!

@pwollstadt pwollstadt self-assigned this Jun 4, 2020
@pwollstadt pwollstadt added the bug label Jun 4, 2020
@william-yuan2012
Copy link

Hi @pwollstadt , I have the same needs as @geogian. I want to know when this bug will be fixed. Thanks a lot!

pwollstadt added a commit that referenced this issue Feb 25, 2021
Fix networkx export of nodes without links. The creation of the DiGraph
object was done by iterating over links in the results. This misses nodes
without links.

Fixes #50.
daehrlich pushed a commit that referenced this issue Aug 2, 2021
Fix networkx export of nodes without links. The creation of the DiGraph
object was done by interating over links in the results. This did not
pick up nodes with no inferred links.

Fixes #50.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants