- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
有谁知道使用 WEKA API 从数据中学习贝叶斯网络的“正确”程序?我在 WEKA 文档中找不到好的说明。
根据文档和每个函数“应该”做什么,我认为这可行:
Instances ins = DataSource.read( filename );
ins.setClassIndex(0);
K2 learner = new K2();
MultiNomialBMAEstimator estimator = new MultiNomialBMAEstimator();
estimator.setUseK2Prior(true);
EditableBayesNet bn = new EditableBayesNet( ins );
bn.initStructure();
learner.buildStructure(bn, ins);
estimator.estimateCPTs(bn);
但事实并非如此。我已经尝试了这个和其他变体,但我一直在 WEKA 代码中的某处收到 ArrayIndexOutOfBoundsException
或 NullPointerException
,那么我错过了什么?
最佳答案
它对我有用。我尝试使用以下数据集:
@relation test
@attribute x {0,1}
@attribute y {0,1,2}
@attribute z {0,1}
@data
0,1,0
1,0,1
1,1,1
1,2,1
0,0,0
让我提一下,当您的目标属性不是名义上的(例如数字)时,预计会出现异常。当您的所有属性都是名义上的时,贝叶斯网络会更好地工作。如果将目标属性更改为数字,您将收到 NullPointerException
或 ArrayIndexOutOfBoundsException
。特别是,在以下行抛出此异常:
EditableBayesNet bn = new EditableBayesNet(ins);
你应该首先离散化你的目标类。
关于java - 如何使用 WEKA API 学习贝叶斯网络(结构+参数)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6143583/
我开始研究应用于计算机视觉和情感计算的机器学习和贝叶斯推理。 如果我理解正确的话,之间有一个很大的讨论 经典信息架构、本体论、语义网络研究人员 以及机器学习和贝叶斯专家 我认为这通常被称为强人工智能与
我有一个 MS SQL Server 2008 数据库,用于存储提供食物的地方(咖啡馆、餐馆、小餐馆等)。在连接到该数据库的网站上,人们可以从 1 到 3 的等级对地点进行评分。 在网站上有一个页面,
我正在努力学习 pyMC 3,但遇到了一些麻烦。由于 pyMC3 的教程有限,我从 Bayesian Methods for Hackers 开始工作.我正在尝试将 pyMC 2 代码移植到 Baye
我是一名优秀的程序员,十分优秀!