bn.cv(learning.test, 'hc', loss = "pred", loss.args = list(target = "F"))
#
# k-fold cross-validation for Bayesian networks
#
# target learning algorithm: Hill-Climbing
# number of subsets: 10
# loss function: Classification Error
# expected loss: 0.509
#
bn.cv(gaussian.test, 'mmhc')
#
# k-fold cross-validation for Bayesian networks
#
# target learning algorithm: Max-Min Hill Climbing
# number of subsets: 10
# loss function: Log-Likelihood Loss (Gaussian)
# expected loss: 10.63062
#
Run the code above in your browser using DataLab