微软dowhy 项目 原理

I recently started a new newsletter focus on AI education. TheSequence is a no-BS( meaning no hype, no news etc) AI-focused newsletter that takes 5 minutes to read. The goal is to keep you up to date with machine learning projects, research papers and concepts. Please give it a try by subscribing below:

我最近开始了一份有关AI教育的新时事通讯。 TheSequence是无BS(意味着没有炒作,没有新闻等),它是专注于AI的新闻通讯,需要5分钟的阅读时间。 目标是让您了解机器学习项目,研究论文和概念的最新动态。 请通过以下订阅尝试一下:

The human mind has a remarkable ability to associate causes with a specific event. From the outcome of an election to an object dropping on the floor, we are constantly associating chains of events that cause a specific effect. Neuropsychology refers to this cognitive ability as causal reasoning. Computer science and economics study a specific form of causal reasoning known as causal inference which focuses on exploring relationships between two observed variables. Over the years, machine learning has produced many methods for causal inference but they remain mostly difficult to use in mainstream applications. Recently, Microsoft Research open sourced DoWhy, a framework for causal thinking and analysis.

人脑具有将原因与特定事件相关联的卓越能力。 从选举的结果到物体掉到地板上,我们一直在关联引起特定效果的事件链。 神经心理学将这种认知能力称为因果推理。 计算机科学和经济学研究因果推理的一种特定形式,即因果推理,该因果推理着重探讨两个观察到的变量之间的关系。 多年来,机器学习已经产生了许多因果推理方法,但在主流应用中仍然很难使用。 最近,Microsoft Research 开源了DoWhy ,这是一个因果思维和分析框架。

The challenge with causal inference is not that is a new discipline, quite the opposite, but that the current methods represent a very small and simplistic version of causal reasoning. Most models that try to connect causes such as linear regression rely on empirical analysis that makes some assumption about the data. Pure causal inference relies on counterfactual analysis which is a closer representation to how humans make decisions. Imagine a scenario in which you are traveling with your families for vacations to an unknown destination. Before and after the vacation you are wrestling with a few counterfactual questions:

因果推理的挑战不是这是一门新学科,而是相反,而是当前的方法代表了因果推理的非常小而简单的版本。 大多数尝试联系起因(例如线性回归)的模型都依赖于对数据进行一些假设的经验分析。 纯粹的因果推论依赖于反事实分析,该反事实分析更接近于人类如何做出决策。 设想一下您与家人一起旅行到未知目的地度假的情况。 假期前后,您会遇到一些反事实问题:

Answering these questions is the focus of causal inference. Unlike supervised learning, causal inference depends on estimation of unobserved quantities. This if often known as the “fundamental problem” of causal inference which implies that a model never has a purely objective evaluation through a held-out test set. In our vacation example, you can either observe the effects on going on vacation or not going on vacations but never both. This challenge forces causal inference to make critical assumptions about the data generation process. Traditional machine learning frameworks for causal inference try to take shortcuts around the “fundamental problem” resulting on a very frustrating experience for data scientists and developers.

回答这些问题是因果推理的重点。 与监督学习不同,因果推理取决于未观察到的量的估计。 这通常被称为因果推理的“基本问题”,这意味着模型永远不会通过坚持的测试集进行纯粹客观的评估。 在我们的休假示例中,您可以观察休假或不休假的影响,但不能同时观察两者。 这一挑战迫使因果推理对数据生成过程做出重要假设。 传统的因果推理机器学习框架试图绕开“基本问题”的捷径,从而给数据科学家和开发人员带来非常令人沮丧的体验。

介绍DoWhy (Introducing DoWhy)

Microsoft’s DoWhy is a Python-based library for causal inference and analysis that attempts to streamline the adoption of causal reasoning in machine learning applications. Inspired by Judea Pearl’s do-calculus for causal inference, DoWhy combines several causal inference methods under a simple programming model that removes many of the complexities of traditional approaches. Compared to its predecessors, DoWhy makes three key contributions to the implementation of causal inference models.

微软的DoWhy 是一个基于Python的因果推理和分析库,旨在简化因果推理在机器学习应用程序中的采用。 受Judea Pearl的因果推理do-演算的启发,DoWhy在简单的编程模型下结合了多种因果推理方法,从而消除了传统方法的许多复杂性。 与以前的版本相比,DoWhy对因果推理模型的实现做出了三个关键贡献。

  1. Provides a principled way of modeling a given problem as a causal graph so that all assumptions explicit.提供将给定问题建模为因果图的原则方法,以便所有假设都明确。
  2. Provides a unified interface for many popular causal inference methods, combining the two major frameworks of graphical models and potential outcomes.为许多流行的因果推断方法提供统一的界面,将图形模型和潜在结果的两个主要框架结合在一起。
  3. Automatically tests for the validity of assumptions if possible and assesses robustness of the estimate to violations.如果可能,自动测试假设的有效性,并评估对违规情况的估计的稳健性。

Conceptually, DoWhy was created following two guiding principles: asking causal assumptions explicit and testing robustness of the estimates to violations of those assumptions. In other words, DoWhy separates the identification of a causal effect from the estimation of its relevance which enables the inference of very sophisticated causal relationships.

从概念上讲,DoWhy的创建遵循两个指导原则:明确提出因果假设,并测试估计值对违反那些假设的稳健性。 换句话说,DoWhy将因果效应的标识与对它的相关性的估计分开,从而可以推断出非常复杂的因果关系。

To accomplish its goal, DoWhy models any causal inference problem in a workflow with four fundamental steps: model, identify, estimate and refute.

为了实现其目标,DoWhy通过四个基本步骤对工作流中的任何因果推断问题进行建模:建模,识别,估计和反驳。

  1. Model: DoWhy models each problem using a graph of causal relationships. The current version of DoWhy supports two formats for graph input: gml (preferred) and dot. The graph might include prior knowledge of the causal relationships in the variables but DoWhy does not make any immediate assumptions.

    模型: DoWhy使用因果关系图为每个问题建模。 当前版本的DoWhy支持两种图形输入格式: gml (首选)和dot 。 该图可能包括变量中因果关系的先验知识,但DoWhy没有立即做出任何假设。

  2. Identify: Using the input graph, DoWhy finds all possible ways of identifying a desired causal effect based on the graphical model. It uses graph-based criteria and do-calculus to find potential ways find expressions that can identify the causal effect

    识别: DoWhy使用输入图,根据图形模型找到识别期望因果效应的所有可能方法。 它使用基于图的标准和do-演算来找到潜在的方式来找到可以识别因果关系的表达式

  3. Estimate: DoWhy estimates the causal effect using statistical methods such as matching or instrumental variables. The current version of DoWhy supports estimation methods based such as propensity-based-stratification or propensity-score-matching that focus on estimating the treatment assignment as well as regression techniques that focus on estimating the response surface.

    估计: DoWhy使用统计方法(例如匹配或工具变量)来估计因果关系。 DoWhy的当前版本支持基于估计的方法,例如基于倾向的分层或倾向得分匹配,这些方法着重于估计治疗分配,以及回归技术着重于估计响应面。

  4. Verify: Finally, DoWhy uses different robustness methods to verify the validity of the causal effect.

    验证:最后,DoWhy使用不同的鲁棒性方法来验证因果效应的有效性。

使用DoWhy (Using DoWhy)

Developers can start using DoWhy by installing the Python module using the following command:

通过使用以下命令安装Python模块,开发人员可以开始使用DoWhy:

python setup.py install

Like any other machine learning program, the first step of a DoWhy application is to load the dataset. In this example, imagine that we are trying to infer the correlation between different medical treatments and outcomes represented by the following dataset.

像任何其他机器学习程序一样,DoWhy应用程序的第一步是加载数据集。 在此示例中,假设我们正在尝试推断不同药物治疗与以下数据集所表示的结果之间的相关性。

Treatment    Outcome        w00   2.964978   5.858518 -3.1733991   3.696709   7.945649 -1.9369952   2.125228   4.076005 -3.9755663   6.635687  13.471594  0.7724804   9.600072  19.577649  3.922406

DoWhy relies on pandas dataframes to capture the input data:

DoWhy依靠熊猫数据框来捕获输入数据:

rvar = 1 if np.random.uniform() >0.5 else 0 data_dict = dowhy.datasets.xy_dataset(10000, effect=rvar, sd_error=0.2) df = data_dict['df']print(df[["Treatment", "Outcome", "w0"]].head())

At this point, we simply need about four steps to infer causal relationships between the variables. The four steps correspond to the four operations of DoWhy: model, estimate, infer and refute. We can start by modeling the problem as a causal graph:

在这一点上,我们只需要大约四个步骤就可以推断变量之间的因果关系。 这四个步骤与DoWhy的四个操作相对应:建模,估计,推断和反驳。 我们可以先将问题建模为因果图:

model= CausalModel(        data=df,        treatment=data_dict["treatment_name"],        outcome=data_dict["outcome_name"],        common_causes=data_dict["common_causes_names"],        instruments=data_dict["instrument_names"])model.view_model(layout="dot")from IPython.display import Image, displaydisplay(Image(filename="causal_model.png"))
Source: https://microsoft.github.io/dowhy/
资料来源: https : //microsoft.github.io/dowhy/

The next step is to identify the causal relationships in the graph:

下一步是确定图中的因果关系:

identified_estimand = model.identify_effect()

Now we can estimate the causal effect and determine if the estimation is correct. This example uses linear regression for simplicity:

现在我们可以估计因果关系并确定估计是否正确。 为了简单起见,本示例使用线性回归:

estimate = model.estimate_effect(identified_estimand,        method_name="backdoor.linear_regression")# Plot Slope of line between treamtent and outcome =causal effectdowhy.plotter.plot_causal_effect(estimate, df[data_dict["treatment_name"]], df[data_dict["outcome_name"]])
Source: https://microsoft.github.io/dowhy/
资料来源: https : //microsoft.github.io/dowhy/

Finally, we can use different technique to refute the causal estimator:

最后,我们可以使用不同的技术来反驳因果估计量:

res_random=model.refute_estimate(identified_estimand, estimate, method_name="random_common_cause")

DoWhy is a very simple and useful framework to implement causal inference models. The current version can be used as a standalone library or integrated into popular deep learning frameworks such as TensorFlow or PyTorch. The combination of multiple causal inference methods under a single framework and the four-step simple programming model makes DoWhy incredibly simple to use for data scientist tackling causal inference problems.

DoWhy是一个非常简单且有用的框架,用于实现因果推理模型。 当前版本可以用作独立库,也可以集成到流行的深度学习框架(如TensorFlow或PyTorch)中。 在一个框架下结合多种因果推断方法和四步简单编程模型,使得DoWhy极其简单地用于数据科学家解决因果推断问题。

翻译自: https://medium.com/@jrodthoughts/microsofts-dowhy-is-a-cool-framework-for-causal-inference-d14013657f35

微软dowhy 项目 原理


http://www.taodudu.cc/news/show-4098023.html

相关文章:

  • WHAT、HOW、WHY
  • dowhy学习1
  • 【笔记】两个根因分析方法:5WHYamp;10WHY
  • 史上最详细的5-Why解说|优思学院
  • 【SAP】在制品报表 查询及结算余额查询
  • 【SAP-CO】成本中心会计报表
  • access简述报表的功能_access中报表的作用
  • 用project做成本概述报表
  • 帆软报表公式
  • BO报表展示
  • 报表工具——开源还是商用
  • CO BW成本报表建立小结
  • 生产订单成本报表
  • SAP中利用标准成本报表计算成品人工成本及组成实例
  • 用友U8案例教程成本报表
  • 计算机教室云教学反思,《云》音乐教学反思
  • 在数学的海洋中飘荡(转自Dahua的Blog)
  • 【转】在数学的海洋中飘荡
  • 我是一片云
  • 高校云平台V3.1版总结
  • 七夕,思念里的流浪狗在哭---众智云
  • python爬音乐评论生成词云图_Python ---网易云音乐评论自动云图生成器
  • 诗云
  • 云自无心水自闲
  • 写作历时一个月,长达8000字的年终总结——[2022年终总结]不要怕,请勇敢的向前走
  • 网易云音乐评论 破解JS加密参数
  • 同方有云,加速领跑信创新时代
  • [转]在数学的海洋中飘荡
  • 我如行云独自游
  • 控制贺尔碧格PRL及PIL模块式RT-PVR6系列比例放大器

微软dowhy 项目 原理_Microsoft的DoWhy是因果推理的出色框架相关推荐

  1. 【周刊】“熊孩子”乱敲键盘攻破 Linux 桌面;500 个值得学习的 AI 开源项目;Rust 升级成为微软一级项目...

    整理 | 梦依丹 出品 | CSDN(ID:CSDNnews) CSDN开发者周刊:只为传递"有趣/有用"的开发者内容! 本周热门项目 0.Rust 升级成为微软一级项目 2015 ...

  2. 微软免费软件项目DreamSpark更名为Microsoft Imagine

    9月10日消息,微软免费软件项目DreamSpark近日正式更名为Microsoft Imagine,将与一年一度的微软"创新杯(Imagine Cup)"齐名. 微软免费软件项目 ...

  3. WFP(三)——编译、部署驱动文件*.sys——微软msnmntr项目

    通过WFP,我们可以编译得到sys驱动文件.此时需要我们把sys驱动文件部署到目标主机上,本文介绍部署的方式方法. 术语 host computer: 宿主主机,开发.编译驱动的主机 target/t ...

  4. 微软 人立方:背后原理_时间到了:微软终于杀了我的人

    微软 人立方:背后原理 Microsoft is killing My People, as predicted. The "My People" feature on the t ...

  5. 微软开源项目-AI修复老照片

    今天介绍一个Python的开源项目,是由微软研究院团队的Ziyu Wan,Bo Zhang等人开发的,通过深度学习方法来恢复受损严重的老照片.github项目地址如下 https://github.c ...

  6. Malmo——微软人工智能项目

    Malmo--微软人工智能项目 Malmo是一个基于Minecraft(我的世界)的人工智能实验和研究平台.我们致力于启发在这个游戏环境下挑战新人工智能问题的新一代研究. 开始这个项目 1.下载最新版 ...

  7. 28款GitHub最流行的开源机器学习项目,推荐GitHub上10 个开源深度学习框架

    20 个顶尖的 Python 机器学习开源项目 机器学习 2015-06-08 22:44:30 发布 您的评价: 0.0 收藏 1收藏 我们在Github上的贡献者和提交者之中检查了用Python语 ...

  8. [vue] 你们项目为什么会选vue而不选择其它的框架呢?

    [vue] 你们项目为什么会选vue而不选择其它的框架呢? Vue.js是一个轻巧.高性能.可组件化的MVVM库,同时拥有非常容易上手的API:vue是单页面应用,使页面局部刷新,不用每次跳转页面都要 ...

  9. 业界 | 英伟达开源硬件加速项目NVDLA:一种标准化的推断加速框架

    https://cloud.tencent.com/developer/article/1119468 目录 业界 | 英伟达开源硬件加速项目NVDLA:一种标准化的推断加速框架 使用 NVDLA 加 ...

  10. 微软开源项目NeuronBlocks - 像搭积木一样构建NLP深度学习模型

    在构建自然语言理解深度学习模型过程中,研究人员或者工程师们经常需要在编程细节和代码调试上花费大量精力,而不是专注于模型架构设计与参数调整.为了提升构建深度模型的效率,微软亚洲互联网工程院自然语言理解团 ...

最新文章

  1. 设计模式 之美 -- 策略模式
  2. 水晶报表设置FiledObject支持HTML格式的数据
  3. java空格 逗号_Java将字符串中的空格换为逗号
  4. Windows 7 时代即将终结!
  5. iOS UIScrollView 动画的力学原理
  6. 在一个字符串中找到第一个只出现一次的字符,并返回它的位置
  7. MATLAB实现自编码器(五)——变分自编码器(VAE)实现图像生成的帮助函数
  8. html打印强制分页
  9. 百度地图街景图片爬取
  10. Python脚本系列:拳皇13一键出招以及连段实现!谁打得过我?
  11. php微信授权登录sdk,微信授权登录如何使用?总结微信授权登录实例用法
  12. Android Activity 生命周期和重要的相关函数(基础一)
  13. 什么是“大中台、小前台”
  14. 基于51单片机PM2.5空气质量检测仪设计(毕设)
  15. 循迹小车 。。。。2 为什么步进电机小车很少见呢
  16. Gaza Cybergang在移动端对阿拉伯语地区的攻击事件
  17. ico的尺寸_批量压缩、加水印、调整尺寸……用这 6 款 Mac 图片工具一键解决
  18. String、StringBuffer 和StringBuilder
  19. Git本地仓库提交代码到远程仓库出现报错:fatal: ‘origin‘ does not appear to be a git repository fatal: Could not read fr
  20. 微信小程序六宫格抽奖

热门文章

  1. android wifi 文件共享,一个Android WiFi 文件共享程序
  2. C++ read()和write()读写二进制文件(超级详细)
  3. php cms下载地址,phpcms将下载地址替换为图片显示
  4. k8s通过Service访问Pod
  5. 识人、识货、识场—— 这就是智能零售该有的样子
  6. Gabor变换(1)
  7. 零基础该怎么去学游戏建模?
  8. 有没有免费又好用的云桌面系统?
  9. 国产手机再次发力,是否可以阻击三星苹果
  10. 一鲸落万物生,公链还需看Hoo Smart Chain,六十余家项目报名万物生长计划