machine-learning - 贝叶斯网络结构学习的数据集
问题描述
经过大量研究,我没有找到包含必要材料的存储库来测试能够学习贝叶斯网络结构的算法。我需要的只有两件事:
- 正确的贝叶斯网络
- 与 BN 相关的数据集
我的算法应该能够从数据集中学习结构,然后我可以检查它离正确的 BN 有多远。你有任何链接吗?我已经找到了一些没有原始 BN 的数据集,反之亦然,但我的大学项目都需要它们。
提前致谢
PS:如果你有兴趣,我在我的项目中使用 Python。
解决方案
试试bnlearn 库。它包含结构学习、参数学习、推理和各种示例数据集,如喷水器、亚洲、警报等等。
结构学习和推理示例:
# Load library
import bnlearn as bn
# Load Asia DAG
DAG = bn.import_DAG('asia')
# plot ground truth
G = bn.plot(DAG)
# Sampling
df = bn.sampling(DAG, n=10000)
# Structure learning
model_sl = bn.structure_learning.fit(df, methodtype='hc', scoretype='bic')
# Plot based on structure learning of sampled data
bn.plot(model_sl, pos=G['pos'], interactive=True)
# Compare networks and make plot
# bn.compare_networks(model, model_sl, pos=G['pos'])
推荐阅读
- terraform-provider-azure - 使用 terraform 创建监控警报的操作名称应该是什么
- python - groupby.apply 更改原始数据框
- go - 如果我们不使用通道,是否可能发生死锁?
- java - ALEngagementZones API 在 QiSDK (Pepper with NAOqi 2.9.5) 中是否仍然可用?
- arrays - 如何使用堆栈解决 N-Queens 问题?
- android - 包含日期和时间列的离子日期选择器
- python - 部署应用程序时dash_auth不起作用
- python - 将数据框的事件 N 行放入熊猫中按日期聚合的列?
- c# - 是否可能:Web App 中的 Selenium 在运行时传递脚本
- excel - Excel Addin 未执行调用函数