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

BIC score for a graph, given data #107

Open
kollibylecoffee opened this issue Oct 28, 2021 · 5 comments
Open

BIC score for a graph, given data #107

kollibylecoffee opened this issue Oct 28, 2021 · 5 comments

Comments

@kollibylecoffee
Copy link

kollibylecoffee commented Oct 28, 2021

Hi,

I'm trying to get a BIC score on a graph given data but most of the time, print('Graph BIC: {}'.format(graph.getAttribute('BIC'))), returns None. I saw the thread about FCI algm returning None if graph returned was a PAG, but thought it was fixed?
On another note, is it possible to get a BIC score on any graph (not just one that was learned), given data? Such as in:
http://bnlearn.com/examples/score/

Thanks!

@jdramsey
Copy link
Contributor

You know, I was just trying to figure out how to implement that in Tetrad. Obviously in the code it's easy. I'm not sure about pycausal, but I should be able to solve it in Tetrad if I can figure out how.

@jdramsey
Copy link
Contributor

Oh wait, I should ask, what types of graphs are you trying to print the BIC of? I recently went through my own code and added BIC attributes to all CPDAG search models. PAG models shouldn't get them.

@kollibylecoffee
Copy link
Author

Thank you for your reply! I have a regular DAG (based on some prior temporal knowledge and forbidden edges) and I wanted to score it based on the data. When you say, "Obviously in the code it's easy. I'm not sure about pycausal," is it correct to assume that the code you are talking about in the java code. Thanks again!

@jdramsey
Copy link
Contributor

Yeah it's in the Java code.....but maybe you can do it from pycausal..... I don't know how to use pycausal, sorry, but I can tell you want to do. The BIC score is in the FGES class--you make and FGES with a SEM BIC score with penalty 1, and then you call this function:P

public double scoreDag(Graph dag) {
    return scoreDag(dag, false);
}

That's the BIC score. Penalty 1 is important--that's standard BIC. Is this something you're able to do from pycausal?

@jdramsey
Copy link
Contributor

It's possible that Kong exposed this function somewhere in the pycausal API. If he sees this, maybe he'll respond.

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

No branches or pull requests

2 participants