简体   繁体   中英

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. 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. 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.

Thankful for any help with this.

See the documentation of bnlearn. predict function implements prob only for naive.bayes and 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. 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.

Hope this helps. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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