Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate bayesian network sample data from learned network structure on R
#sudo apt install r-base-core #the latest version will not be installed by this command
#install.packages("bnlearn", dependencies = TRUE)
library(bnlearn)
data(alarm)
res = read.bif("./alarm.bif") #http://www.bnlearn.com/bnrepository/discrete-medium.html#alarm
sim = rbn(res, 500, alarm)
write.csv(sim, "./alarm.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.