felixleopoldo / benchpress

A Snakemake workflow to run and benchmark structure learning (a.k.a. causal discovery) algorithms for probabilistic graphical models.
https://benchpressdocs.readthedocs.io
GNU General Public License v2.0
64 stars 17 forks source link

Write and plot edge weights #42

Open felixleopoldo opened 1 year ago

felixleopoldo commented 1 year ago

Some algorithms, like no tears, estimates edge weights/parameters. It should be possible to access these. It can be done by adding another output field, edge_weights, to the rules corresponding to these algorithms. For mcmc algorithms there should be a general converter rule that creates an estimate of the edge probabilities.

annlia commented 1 year ago

Do weights and parameters refer to different things in this case? With the exception of mcmc algorithms (sampling methods), other algorithms will not provide "edge probabilities". Does parameter or weight refer instead to the parameter describing the local probability distributions (e.g. of a child given the parents?) Presumably, in the case of no tears, they are the parameters of the SEM describing local distributions? For clarity, it should be made clear if the weights represent different quantities for different algorithms.

felixleopoldo commented 1 year ago

Yes, they may refer to different quantities, for example the weights of a graphical lasso estimate are different from notears. As many algorithms have output that may be interpreted as edge weights it would just be good to have the ability to get access to that and also an evaluation module, called e.g. plot_edge_weigths, that may produce a plot of a graph or a matrix, where the edges are colored according to the weights. I agree it would probably be good with a reminder, e.g. in the plots, that the edge for different algorithms may not be comparable.

felixleopoldo commented 1 year ago

It would also be good to be able to produce any type of parameter estimates. However, since there is no general way of visualizing them, I thought that in the case they can be interpreted as a edge weights, and the weights are anyway part of the structure learning algorithms output, it would be nice to exploit that.