创建贝叶斯网络并使用Python3.x学习参数 [英] Create Bayesian Network and learn parameters with Python3.x

查看:124
本文介绍了创建贝叶斯网络并使用Python3.x学习参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找Windows上最适合python3.x的工具,以创建贝叶斯网络,从数据中了解其参数并进行推断.

I'm searching for the most appropriate tool for python3.x on Windows to create a Bayesian Network, learn its parameters from data and perform the inference.

我要定义自己的网络结构如下:

The network structure I want to define myself as follows:

它取自这篇 论文.

除了大小"和"GraspPose"(它们是连续的,应将其建模为高斯混合模型)之外,所有变量都是离散的(并且只能采用2种可能的状态).

All the variables are discrete (and can take only 2 possible states) except "Size" and "GraspPose", which are continuous and should be modeled as Mixture of Gaussians.

作者使用期望最大化算法来学习条件概率表的参数,并使用连接树算法来计算精确的推论.

Authors use Expectation-Maximization algorithm to learn the parameters for conditional probability tables and Junction-Tree algorithm to compute the exact inference.

据我所知,所有这些都是通过Murphy的Bayes Net Toolbox在MatLab中实现的.

As I understand all is realised in MatLab with Bayes Net Toolbox by Murphy.

我试图在python中搜索类似内容,这是我的结果:

I tried to search something similar in python and here are my results:

  1. Python贝叶斯网络工具箱 http://sourceforge.net/projects/pbnt.berlios/( http://pbnt.berlios.de/).网站无法正常工作,似乎不支持项目.
  2. BayesPy https://github.com/bayespy/bayespy 我认为这是我真正需要的,但是我无法找到一些与我的案例类似的示例,以了解如何进行网络结构的构建.
  3. PyMC似乎是一个功能强大的模块,但是我在Windows 64 python 3.3上导入它时遇到了问题.安装开发版本

  1. Python Bayesian Network Toolbox http://sourceforge.net/projects/pbnt.berlios/ (http://pbnt.berlios.de/). Web-site doesn't work, project doesn't seem to be supported.
  2. BayesPy https://github.com/bayespy/bayespy I think this is what I actually need, but I fail to find some examples similar to my case, to understand how to approach construction of the network structure.
  3. PyMC seems to be a powerful module, but I have problems with importing it on Windows 64, python 3.3. I get error when I install development version

警告(theano.configdefaults):未检测到g ++!Theano将无法执行优化的C实现(针对CPU和GPU),并且默认为Python实现.性能将严重下降.要删除此警告,请将Theano标志cxx设置为空字符串.

WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.

更新:

  1. libpgm( http://pythonhosted.org/libpgm/).正是我需要的,不幸的是python 3.x不支持
  2. 非常有趣且积极开发的库:PGMPY.不幸的是,尚不支持连续变量和从数据中学习. https://github.com/pgmpy/pgmpy/
  1. libpgm (http://pythonhosted.org/libpgm/). Exactly what I need, unfortunately not supported by python 3.x
  2. Very interesting actively developing library: PGMPY. Unfortunately continuous variables and learning from data is not supported yet. https://github.com/pgmpy/pgmpy/

我们将不胜感激任何建议和具体示例.

Any advices and concrete examples will be highly appreciated.

推荐答案

最近看来石榴更新为包括贝叶斯网络.我自己还没有尝试过,但是界面看起来不错,看起来很滑.

It looks like pomegranate was recently updated to include Bayesian Networks. I haven't tried it myself, but the interface looks nice and sklearn-ish.

这篇关于创建贝叶斯网络并使用Python3.x学习参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆