Simple Bayesian Network/ Sprinkler example

@janislavjankov, sure.

Given data like [{ rain = 1, sprinkler = 1, grass_wet = 1 }, {rain = 1, sprinkler = 0, grass_wet =0}, …], how do we infer the probability of it raining?

In the code sample, the probability was hard coded to 0.2. However, I want to be able to infer this parameter (and/or other parameters such as p_grass_wet). In particular, I want it to be based on multiple observations. In the example you’ve given, there is one observation that grass_wet = 1.

I had attempted this earlier with this post (Simple Hierarchical Distribution), but I think I was quite confused in several respects. In particular, I wasn’t sure how to plug in a lot of data and be able to do inference.