使用bnlearn包对贝叶斯网络进行结构学习和参数学习后,如何再根据训练样本进一步进行预测呢?
关于贝叶斯网络预测方法实现,网上有一个DEMO,详见:http://www.r-bloggers.com/lang/chinese/1065,
但是为什么执行到
predict(fitted,data=data2,node='class') 弹出如下错误呢
> predict(object=fitted, data=data2, node='class')
错误于gaussian.prediction(node = node, fitted = object, data = data, :
REAL() can only be applied to a 'numeric', not a 'NULL'
>