简体   繁体   English

R中的贝叶斯网络输出后验分布(bnlearn)

[英]Output posterior distribution from bayesian network in R (bnlearn)

I'm experimenting with Bayesian networks in R and have built some networks using the bnlearn package. 我正在R中试用贝叶斯网络,并已使用bnlearn软件包构建了一些网络。 I can use them to make predictions for new observations with predict(), however I would also like to have the posterior distribution over the possible classes. 我可以使用它们通过predict()对新的观察结果进行预测,但是我也希望在可能的类上具有后验分布。 Is there a way of retrieving this information? 有没有办法检索此信息?

It seems like there is a prob-parameter that does this for the naive bayes implementation in the bnlearn package, but not for networks fitted with bn.fit. 似乎有一个prob参数可以对bnlearn包中的朴素贝叶斯实现执行此操作,但不适用于装有bn.fit的网络。

Thankful for any help with this. 感谢您对此的任何帮助。

See the documentation of bnlearn. 请参阅bnlearn的文档。 predict function implements prob only for naive.bayes and TAN. 预测函数仅对naive.bayes和TAN实现概率。


In short, because all other methods do not necessarily compute posterior probabilities. 简而言之,因为所有其他方法不一定都可以计算后验概率。


[bnlearn] :: predict returns the predicted values for node given the data specified by data. [bnlearn] ::预测在给定data指定的数据的情况下返回节点的预测值。 Depending on the value of method, the predicted values are computed as follows: a)parents b)bayes-lw When using bayes-lw , likelihood weighting simulations are performed for making predictions. 根据方法的值,预测值的计算如下:a)父母b)贝叶斯-lw当使用贝叶斯-lw时,将执行似然加权模拟以进行预测。

Hope this helps. 希望这可以帮助。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM