网易首页 > 网易号 > 正文 申请入驻

因果发现工具箱

0
分享至

导语

Causal Discovery Toolbox (cdt)是一个应用于图模型和Pyhton >=3.5 版本中的因果推断工具箱。包含了图结构恢复和相关依赖。该工具箱基于以下模块和语言构建:Numpy、Sciki-learn、Pytorch、R。

该工具箱包含了很多基于观测数据进行图结构恢复的算法(诸如 bnlearn、pcalg 算法)。

Leo| 编译

邓一雪| 编辑

文档题目: Causal Discovery Toolbox Documentation ‒ Causal Discovery Toolbox 0.5.23 documentation 文档链接:: https://fentechsolutions.github.io/CausalDiscoveryToolbox/html/index.html

Docker 镜像

该工具箱提供了Docker镜像,镜像中包含了所有依赖和启动项。

安装

需要版本号不低于 3.5 的Pyhton,以及 requirements.txt 中所列举出的模块。如果需要使用额外的功能则需要安装更多的模块。在安装指南中可以看到最小安装和完全安装的方式。

注意:对于非专业用户而言,(mini/ana) conda 框架有助于管理相关依赖。请查阅官网 http://pytorch.org 获取相关的配置信息。

安装 PyTorch

由于cdt(CausalDiscoveryToolbox)模块模块中的关键算法使用了 PyTorch 模块,所以需要安装PyTorch。

通过 PyPi 安装 CausalDiscoveryToolbox

可通过PyPi安装相关模块:

pip install cdt

也可以通过源代码安装

$ git clone https://github.com/FenTechSolutions/CausalDiscoveryToolbox.git # Download the package

$ cd CausalDiscoveryToolbox

$ pip install -r requirements.txt # Install the requirements

$ python setup.py install develop --user

安装完成后就可以导入运行模块。CausalDiscoveryToolbox 中的大多数算法应该都可以使用,不可用的算法会看到警告。

可通过一下方式导入模块:

import cdt

文档中包含了该模块的额外信息:

https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/master/documentation.md

R语言与R语言库

如果要在使用 cdt 模块中,使用诸如 nlearn、kpcalg、pcalg 等由 R 语言编写的的算法,就需要安装 R 语言。

travis.yml 文件的预安装部分可以查看基于 Debian 的R语言安装依赖。r-requirements 文件则包含了 cdt 模块所需要的 R 语言包。

文件总览

模块包结构

下图展现了相关的模块与算法包结构

硬件与算法设置

该工具箱有一个SETTING类可用于对硬件进行设置。这些设置是唯一的。默认参数定义于cdt/utils/Settings

可以通过一下代码访问并修改配置

import cdt

cdt.SETTINGS

此外在启动时,可以使用 cdt.utils.Settings.autoset_settings 方法来自动配置硬件参数(例如,GPU,CPU数量,可选软件包的数量)

图类

相关模块用到了两个基于 networkx 的类,分别是:DiGraph 和 Graph。

参考

[1] Wang, S., Nan, B., Rosset, S., & Zhu, J. (2011). Random lasso. The annals of applied statistics, 5(1), 468.

[2] Friedman, J., Hastie, T., & Tibshirani, R. (2008). Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9(3), 432-441.

[3] Yamada, M., Jitkrittum, W., Sigal, L., Xing, E. P., & Sugiyama, M. (2014). High-dimensional feature selection by feature-wise kernelized lasso. Neural computation, 26(1), 185-207.

[4] Feizi, S., Marbach, D., Médard, M., & Kellis, M. (2013). Network deconvolution as a general method to distinguish direct dependencies in networks. Nature biotechnology, 31(8), 726-733.

[5] Guyon, I., Weston, J., Barnhill, S., & Vapnik, V. (2002). Gene selection for cancer classification using support vector machines. Machine learning, 46(1), 389-422.

[6] Vapnik, V., Golowich, S. E., & Smola, A. J. (1997). Support vector method for function approximation, regression estimation and signal processing. In Advances in neural information processing systems (pp. 281-287).

[7] Kira, K., & Rendell, L. A. (1992, July). The feature selection problem: Traditional methods and a new algorithm. In Aaai (Vol. 2, pp. 129-134).

[8] MacKay, D. J. (1992). Bayesian interpolation. Neural Computation, 4, 415–447.

[9] Neal, R. M. (1996). Bayesian learning for neural networks. No. 118 in Lecture Notes in Statistics. New York: Springer.

[10] Gretton, A., Bousquet, O., Smola, A., & Scholkopf, B. (2005, October). Measuring statistical dependence with Hilbert-Schmidt norms. In ALT (Vol. 16, pp. 63-78).

[11] Vinh, N. X., Epps, J., & Bailey, J. (2010). Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. Journal of Machine Learning Research, 11(Oct), 2837-2854.

[12] Goudet, O., Kalainathan, D., Caillou, P., Lopez-Paz, D., Guyon, I., Sebag, M., ... & Tubaro, P. (2017). Learning functional causal models with generative neural networks. arXiv preprint arXiv:1709.05321.

[13] Spirtes, P., Glymour, C., Scheines, R. (2000). Causation, Prediction, and Search. MIT press.

[14] Hoyer, P. O., Janzing, D., Mooij, J. M., Peters, J., & Schölkopf, B. (2009). Nonlinear causal discovery with additive noise models. In Advances in neural information processing systems (pp. 689-696).

[15] Janzing, D., Mooij, J., Zhang, K., Lemeire, J., Zscheischler, J., Daniušis, P., ... & Schölkopf, B. (2012). Information-geometric approach to inferring causal directions. Artificial Intelligence, 182, 1-31.

[16] Lopez-Paz, D., Muandet, K., Schölkopf, B., & Tolstikhin, I. (2015, June). Towards a learning theory of cause-effect inference. In International Conference on Machine Learning (pp. 1452-1461).

[17] Lopez-Paz, D., Nishihara, R., Chintala, S., Schölkopf, B., & Bottou, L. (2017, July). Discovering causal signals in images. In Proceedings of CVPR.

[18] Stegle, O., Janzing, D., Zhang, K., Mooij, J. M., & Schölkopf, B. (2010). Probabilistic latent variable models for distinguishing between cause and effect. In Advances in Neural Information Processing Systems (pp. 1687-1695).

[19] Zhang, K., & Hyvärinen, A. (2009, June). On the identifiability of the post-nonlinear causal model. In Proceedings of the twenty-fifth conference on uncertainty in artificial intelligence (pp. 647-655). AUAI Press.

[20] Fonollosa, J. A. (2016). Conditional distribution variability measures for causality detection. arXiv preprint arXiv:1601.06680.

[21] Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., & Smola, A. (2012). A kernel two-sample test. Journal of Machine Learning Research, 13(Mar), 723-773.

[22] Li, Y., Swersky, K., & Zemel, R. (2015). Generative moment matching networks. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15) (pp. 1718-1727).

[23] Margaritis D (2003). Learning Bayesian Network Model Structure from Data . Ph.D. thesis, School of Computer Science, Carnegie-Mellon University, Pittsburgh, PA. Available as Technical Report CMU-CS-03-153

[24] Tsamardinos I, Aliferis CF, Statnikov A (2003). “Algorithms for Large Scale Markov Blanket Discovery”. In “Proceedings of the Sixteenth International Florida Artificial Intelligence Research Society Conference”, pp. 376-381. AAAI Press.

[25] Tsamardinos I, Aliferis CF, Statnikov A (2003). “Time and Sample Efficient Discovery of Markov Blankets and Direct Causal Relations”. In “KDD ’03: Proceedings of the Ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining”, pp. 673-678. ACM. Tsamardinos I, Brown LE, Aliferis CF (2006). “The Max-Min Hill-Climbing Bayesian Network Structure Learning Algorithm”. Machine Learning,65(1), 31-78.

[26] Kalainathan, Diviyan & Goudet, Olivier & Guyon, Isabelle & Lopez-Paz, David & Sebag, Michèle. (2018). SAM: Structural Agnostic Model, Causal Discovery and Penalized Adversarial Learning.

[27] Aragam, B., & Zhou, Q. (2015). Concave penalized estimation of sparse Gaussian Bayesian networks. Journal of Machine Learning Research, 16, 2273-2328.

[28] Bloebaum, P., Janzing, D., Washio, T., Shimizu, S., & Schoelkopf, B. (2018, March). Cause-Effect Inference by Comparing Regression Errors. In International Conference on Artificial Intelligence and Statistics (pp. 900-909).

[29] Structural Intervention Distance (SID) for Evaluating Causal Graphs, Jonas Peters, Peter Bühlmann: https://arxiv.org/abs/1306.1043

(参考文献可上下滑动查看)

因果科学读书会第三季

由智源社区、集智俱乐部联合举办的,将主要面向两类人群:如果你从事计算机相关方向研究,希望为不同领域引入新的计算方法,通过大数据、新算法得到新成果,可以通过读书会各个领域的核心因果问题介绍和论文推荐快速入手;如果你从事其他理工科或人文社科领域研究,也可以通过所属领域的因果研究综述介绍和研讨已有工作的示例代码,在自己的研究中快速开始尝试部署结合因果的算法。读书自2021年10月24日开始,每周日上午 10:00-12:00举办,持续时间预计 2-3 个月。

详情请见:




特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。

Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.

相关推荐
热点推荐
只有造假,才能“杰青”

只有造假,才能“杰青”

必记本
2026-05-16 09:42:33
网曝吉林一大学男生偷女生内衣?校方回应!

网曝吉林一大学男生偷女生内衣?校方回应!

吉林乌拉侯
2026-05-16 07:45:42
农村留守妇女最怕的,不是孤单,是打工丈夫突然回家!

农村留守妇女最怕的,不是孤单,是打工丈夫突然回家!

农夫也疯狂
2026-05-08 15:39:35
一个害国害民的历史罪人,老百姓还把他当成英雄崇拜

一个害国害民的历史罪人,老百姓还把他当成英雄崇拜

小豫讲故事
2026-04-19 06:00:10
网红烤串店主动退款110万 近5万桌顾客收到钱 只因“口感未达最佳” 门店已全面整改设备 重新培训员工

网红烤串店主动退款110万 近5万桌顾客收到钱 只因“口感未达最佳” 门店已全面整改设备 重新培训员工

闪电新闻
2026-05-15 18:55:34
“她那个高度,我没到过。”邓亚萍这句话,才是孙颖莎最让人后背发凉的地方

“她那个高度,我没到过。”邓亚萍这句话,才是孙颖莎最让人后背发凉的地方

乒乓乐园
2026-05-15 17:34:58
安徽多地纪委监委通报:2人被查,2人被处理!

安徽多地纪委监委通报:2人被查,2人被处理!

凤凰网安徽
2026-05-16 16:39:21
广东宏远休赛期第一签!年轻后卫李文昊续约敲定,薪资翻倍正式升级

广东宏远休赛期第一签!年轻后卫李文昊续约敲定,薪资翻倍正式升级

烟浔渺渺
2026-05-16 10:25:15
中央定调!2026养老金或再调整,为何1955年以前出生的更受益?

中央定调!2026养老金或再调整,为何1955年以前出生的更受益?

云鹏叙事
2026-05-15 23:59:18
大陆给台湾问题定调,国民党抛出统一模式,国台办:已有最佳方案

大陆给台湾问题定调,国民党抛出统一模式,国台办:已有最佳方案

长星寄明月
2026-05-16 11:30:06
NBA历史总薪资前十是谁?浓眉3.6亿垫底,库里4.7亿第3,2人超5亿

NBA历史总薪资前十是谁?浓眉3.6亿垫底,库里4.7亿第3,2人超5亿

你的篮球频道
2026-05-16 08:04:16
日媒曝高市要访华,主动低头求和,并笃定一个事情,中方如何接招

日媒曝高市要访华,主动低头求和,并笃定一个事情,中方如何接招

基斯默默
2026-05-15 20:20:33
吃兰州拉面的人为什么越来越少了?网友:进店小心翼翼的怕说错话

吃兰州拉面的人为什么越来越少了?网友:进店小心翼翼的怕说错话

另子维爱读史
2026-02-27 20:31:34
入夏喜提“历史第三早”,下周上海开启“雨雨雨+闷闷闷”模式|丹丹看天气

入夏喜提“历史第三早”,下周上海开启“雨雨雨+闷闷闷”模式|丹丹看天气

上观新闻
2026-05-16 14:03:44
用了多年手机号要大变!中国移动率先带头,关系每个人

用了多年手机号要大变!中国移动率先带头,关系每个人

林子说事
2026-05-16 20:34:24
5月16日 广东队传来3大消息 黄明依接受租借 朱芳雨谈判失败 徐杰

5月16日 广东队传来3大消息 黄明依接受租借 朱芳雨谈判失败 徐杰

奥字侃剧
2026-05-16 23:59:41
梅西被夏奇拉写进世界杯主题曲!还在美国有冠名一条路!

梅西被夏奇拉写进世界杯主题曲!还在美国有冠名一条路!

历史第一人梅西
2026-05-16 17:12:16
去世老师一脉都被清除了

去世老师一脉都被清除了

毒舌扒姨太
2026-05-16 22:48:01
其实,男人遇见深爱的女人,往往不是变大方,而是会下意识有这两个反常

其实,男人遇见深爱的女人,往往不是变大方,而是会下意识有这两个反常

心理观察局
2026-05-15 09:45:41
“杀他全家也不解恨”,讨薪1560元20次遭拒,农民工怒杀老板全家

“杀他全家也不解恨”,讨薪1560元20次遭拒,农民工怒杀老板全家

易玄
2026-05-12 18:58:46
2026-05-17 04:07:00
集智俱乐部 incentive-icons
集智俱乐部
科普人工智能相关知识技能
5825文章数 4674关注度
往期回顾 全部

科技要闻

涨的是车价,要的是老命

头条要闻

又想“抹黑”中国 福克斯新闻“翻车”了

头条要闻

又想“抹黑”中国 福克斯新闻“翻车”了

体育要闻

马刺2号,少年老成,这集看过?

娱乐要闻

谢霆锋北京街头骑行被偶遇,侧颜帅炸

财经要闻

造词狂魔贾跃亭

汽车要闻

大五座SUV卷王!乐道L80上市 租电15.68万元起

态度原创

亲子
教育
家居
数码
手机

亲子要闻

孕晚期如何做到只长胎不长肉?

教育要闻

民办暴走,是绝地反击,还是回光返照?

家居要闻

110㎡淡而有致的生活表达

数码要闻

科技巨头访华遇618 苹果、高通、英伟达集中促销中

手机要闻

王者归来!华为Mate 80系列半年狂销近600万台:国产旗舰销冠实锤

无障碍浏览 进入关怀版