Created
November 7, 2019 08:06
-
-
Save lp6m/54ac9a95182610c9643928578f11dcb6 to your computer and use it in GitHub Desktop.
Generate bayesian network sample data from learned network structure on R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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