如何在贝叶斯网络中实现 "XOR"?

How to Implement "XOR" in Bayesian Networks?

在图形模型和贝叶斯网络中,您如何实现 XOR problem

我在这里阅读 bayesian network vs bayes classifier

A Naive Bayes classifier is a simple model that describes particular class of Bayesian network - where all of the features are class-conditionally independent. Because of this, there are certain problems that Naive Bayes cannot solve (example below). However, its simplicity also makes it easier to apply, and it requires less data to get a good result in many cases.

Example: XOR You have a learning problem with binary features x_1, x_2 and a target variable y = x_1 XOR x_2.

In a Naive Bayes classifier, x_1 and x_2 must be treated independently - so you would compute things like "The probability that y = 1 given that x_1 = 1" - hopefully you can see that this isn't helpful, because x_1 = 1 doesn't make y = 1 any more or less likely. Since a Bayesian network does not assume independence, it would be able to solve such a problem.

我用谷歌搜索,但无法弄清楚如何。有人可以给我提示或好的参考吗?谢谢!

这其实很简单。

模型的 DAG 看起来像

 x1 -> XOR <- x2

然后可以写出异或节点的概率分布

x1  x2  | P(XOR=1|x1,x2)
0   0   |    0
0   1   |    1
1   0   |    1
1   1   |    0