| sample_motbfs | R Documentation |
This function generates a sample from an MoTBF Bayesian network.
sample_motbfs(bn, n, parallel = FALSE, evidence = NULL)
bn |
An object of class motbf_fit, obtained from the function motbf.fit. |
n |
A non-negative integer giving the number of instances to be generated. |
parallel |
A |
evidence |
A data.frame of one row containing the values for the observed variables. As a default, it is NULL. |
A data.frame containing the generated sample. Is evidence is not NULL, attribute 'w' contains the weight of each sample.
data("ecoli", package = "MoTBFs")
dat <- ecoli[,-c(1,4,5,9)]
# Build DAG
dag <- LearningHC(dat)
# Learn BN parameters
bn = motbf.fit(dag, dat)
# Get sample from bn
sam = sample_motbfs(bn, 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.