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

Explain source of the obtained utility #69

Open
bbkjunior opened this issue Dec 10, 2022 · 3 comments
Open

Explain source of the obtained utility #69

bbkjunior opened this issue Dec 10, 2022 · 3 comments

Comments

@bbkjunior
Copy link

Hey! I am making my Ph.D. in NLG to explain Bayesian Networks inference.
I was playing with your code to solve some almost real-life complex questions with the power of Decision Networks.
I was able to do that but some parts of the results did not seem very intuitive to me, so I tried to think about how to make it explainable.

I simplified the Network just to two evidence nodes, one decision, and one Utility node.
image

I used your code (CID class) and my simplified version of code suitable for only this kind of simple conditions, verified that I get the same utility, and then I had an idea of how to get the entity that would make the calculated utility more understandable.

That is what I did
image

To make it clear, these two tables correspond to possible actions that can be selected.
Each column corresponds to possible scenarios that can happen, and then for each scenario, we have the corresponding utility, the probability, and the utility weighted wrt the probability. When we have this we can, for example, sort the list of weighted utilities and see which elements corresponding to which scenario affect most of all the expected utility.

So my question or probably a feature request is whether I can get something like that from your code.

I tried to dive into your code to understand whether I can get something similar from it. Probably I need to spend more time on it but for now, I can see that the point that looks closer to what I want is StochasticFunctionCPD which stores every combination of evidence nodes and utility value corresponding to it. If you think is feasible within your code and give me an incentive from where to start I can consider implementing the feature and making a pull request. If this is already doable in your code I will also be happy=)

Thank you in advance!

@Jamesfox1
Copy link
Collaborator

Hi Nikolay,

Thanks for reaching out! I think you can do something similar to what you’re trying to do in PyCID, but you’re right that making it an explicit feature would be helpful!

I think the easiest thing will be for you to create a Google Colab notebook with your example above in it, and then share it with me (either on here or direct via my email [email protected]) so I can see the code that you've written.

I can then edit that colab notebook to suggest what one can currently do with PyCID.

We can then perhaps chat over a call/liase over email about what new features would be most useful for your work – and yes, any additional features can then be merged into the codebase.

Best,
James

@bbkjunior
Copy link
Author

Sorry for the long response time. I did not expect you would respond that quick=)
I have prepared ColabNotebook. Please have a look and give me some feedback upon availability.

You may reach me at [email protected] or here as well.

@Jamesfox1
Copy link
Collaborator

Hi @bbkjunior

I assume this was resolved?

I just had a look a look at your colab and I couldn't immediately see that you were pointing out any issues?

It looked like a nice application though. Feel free to polish that colab slightly more and then create a pull request to add it to the collection of notebooks https://github.com/causalincentives/pycid/tree/master/notebooks. It's good to have a range of notebooks displaying a wide range of applications of this codebase :)

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