歸因分析
By Lisa Cohen, Ryan Bouchard, Jane Huang, Daniel Yehdego and Siddharth Kumar
由 麗莎·科恩 , 瑞安布沙爾 , 黃美珍 , 丹尼爾Yehdego 和 亞洲時報Siddharth庫馬爾
介紹 (Introduction)
This is our second article in a series where we focus on methods for determining the impact of customer engagement efforts, a common question that data scientists face in the enterprise. In our last article, we showed methods for attribution analysis in cases where there are one or many treatments in play (using single or multi-attribution). Those methods provide ways to quantify the correlation between treatments and outcome metrics. In this article, we’ll cover causal inference techniques to determine causality. We’ll also share approaches that we’ve taken to make this analysis actionable for the business.
這是我們系列的第二篇文章,我們重點介紹確定客戶參與工作影響的方法,這是數據科學家在企業中面臨的一個常見問題。 在上一篇文章中 ,我們展示了在進行一種或多種治療(使用單一或多種歸因)的情況下的歸因分析方法。 這些方法提供了量化治療與結果指標之間相關性的方法。 在本文中,我們將討論因果推斷技術以確定因果關系。 我們還將分享使該分析對企業可行的方法。
因果推論 (Causal inference)
We’ve discussed the distinction between techniques that allow us to conclude correlation versus those that indicate causation. “Correlation does not imply causation” is a common reminder in the field of statistics and data science. This site features several amusing spurious correlations to remind us about the importance of not conflating these two concepts. Another method (beyond randomized controlled trials “RCTs”) that we use to evaluate causation is causal inference. This is particularly valuable in scenarios where it’s not feasible to run an experiment due to business considerations. The Book of Why, by Judea Pearl, is a fun and accessible read for those interested in an introduction to this topic. The Coursera course “A Crash Course in Causality: Inferring Causal Effects from Observational Data” is another good reference.
我們已經討論了允許我們得出相關性的技術與表明因果關系的技術之間的區別。 “關聯不表示因果關系”是統計和數據科學領域的常見提示。 該站點具有幾個有趣的虛假關聯,以提醒我們不要混淆這兩個概念的重要性。 我們用來評估因果關系的另一種方法(超出隨機對照試驗“ RCT”)是因果推斷 。 在出于商業考慮而無法進行實驗的情況下,這特別有價值。 Judea Pearl撰寫的《為什么》一書對那些對此主題介紹感興趣的人來說是一本有趣且容易閱讀的書。 Coursera課程“ 因果關系速成課程:從觀測數據推斷因果效應 ”是另一個很好的參考。
The first step in causal modeling is to develop the causal diagram. A key activity as part of this work is hypothesizing the variables that could have an impact on the outcomes, which requires a combination of business context and a healthy dose of imagination. A good approach to this is asking “What if?” questions. Causal diagrams include the treatment under review, the desired goal or outcome, and confounding variables (i.e., other variables that can also have an impact on the outcome):
因果建模的第一步是開發因果圖 。 作為這項工作的一部分,一項關鍵活動是假設可能影響結果的變量,這需要結合業務環境和健康的想象力。 一個很好的方法是問“如果?” 問題。 因果圖包括正在審查的治療,期望的目標或結果以及混淆的變量(即,其他也會影響結果的變量):
In our example above, the treatment is the investment program that is aimed at helping customers be successful in their adoption of the Azure cloud. A key outcome we measure is their usage of Azure. Finally, the confounding variables include customer size, geography, industry, types of Azure services used, usage levels, and so on. Ultimately, confounding variables include many of the factors that you would typically control for in a RCT.
在上面的示例中, 治療是一種投資計劃,旨在幫助客戶成功采用Azure云。 我們衡量的關鍵結果是對Azure的使用。 最后, 令人困惑的變量包括客戶規模,地理位置,行業,所使用的Azure服務類型,使用級別等。 最終,混雜變量包括許多您通常在RCT中要控制的因素。
We also consider instrumental variables, which don’t influence the outcome directly but have an impact on the treatment and therefore affect the outcome indirectly. For example, someone’s attitude toward safety influences their likelihood to wear a seatbelt, as well as their driving practices, which both lead to safety results. Similarly, someone’s lifestyle affects their likeliness of taking prescribed medications, as well as maintaining other healthy habits, which in turn lead to health results. In the context of our scenarios, the relative effectiveness and attitudes of different program administrators have an impact on the program engagement and ultimately program results. Therefore if the assignment of program administrators is random, we can consider the program administrator assignment to be an instrumental variable and use an algorithm like double least square to estimate treatment effects.
我們還考慮了儀器變量 ,這些變量不會直接影響結果,但會影響治療并因此間接影響結果。 例如,某人對安全的態度會影響他們系上安全帶的可能性以及駕駛習慣,這都會導致安全后果。 同樣,某人的生活方式會影響他們服用處方藥以及維持其他健康習慣的可能性,從而導致健康結果。 在我們的方案中,不同計劃管理員的相對有效性和態度會對計劃參與度和最終計劃結果產生影響。 因此,如果程序管理員的分配是隨機的,我們可以將程序管理員的分配視為工具變量,并使用像雙最小二乘這樣的算法來估計治療效果。
Here is what our resulting causal diagram looks like:
這就是我們產生的因果關系圖:

Once we define the causal diagram, next we compile the data. Here are the dimensions we include for the current example:
一旦定義了因果圖,接下來我們將編譯數據。 以下是我們為當前示例提供的尺寸:

For causal inference modeling, developing the dataset is one of the most critical — albeit time-consuming — parts of the process. Basically, we need to construct a control and treatment that have matching confounding variable values, as if we had set them up as a controlled experiment to begin with. Then we can run the usual statistical tests, prove or disprove hypotheses, and determine causality. In the case of a single attribution (single treatment) problem, we can directly compare these two groups, either by matching subsets of the population (if the sample size is large enough) or by comparing larger populations with matching frequencies of the confounding variables.
對于因果推理建模,開發數據集是過程中最關鍵(盡管很耗時)的部分之一。 基本上,我們需要構造一個具有匹配的混雜變量值的對照和處理方法,就好像我們將它們設置為受控實驗一樣。 然后,我們可以運行常規的統計檢驗,證明或反駁假設,并確定因果關系。 在單一歸因(單一處理)問題的情況下,我們可以通過匹配總體子集(如果樣本量足夠大)或通過比較更大的總體和混雜變量的匹配頻率來直接比較這兩組。
In the case of a multi-attribution problem with n treatments, we can either model each investment separately and control for all other investments, or allow a combination of treatments in the treatment space and then allocate the treatment effects to each investment.
對于具有n種處理的多屬性問題,我們可以分別為每個投資建模并控制所有其他投資,或者允許在處理空間中組合處理,然后將處理效果分配給每個投資。
One challenge that we face in this work is to ensure that our treatment and “constructed control” are appropriately matched with respect to the confounding variables. Here are a few techniques that we leverage for this:
我們在這項工作中面臨的一個挑戰是,要確保我們的治療和“結構化控制”在混雜變量方面適當匹配。 這是我們可以利用的一些技術:
- Covariate matching: Obtain treated and controlled groups with similar covariate distributions (in our case, the confounding variables above) so that we can replicate a randomized experiment as closely as possible. 協變量匹配:獲得具有相似協變量分布的治療組和對照組(在我們的情況下,是上面的混雜變量),以便我們可以盡可能地復制隨機實驗。
Propensity score matching (PSM) (as outlined in Stuart, Elizabeth 2010): Estimate the effect of an intervention by accounting for the covariates that predict receiving the treatment. (In the case of our example, propensity refers to the propensity for a customer to participate in a particular program.)
傾向得分匹配(PSM)(如Stuart,Elizabeth 2010所述 ):通過考慮預測接受治療的協變量來估計干預措施的效果。 (在我們的示例中,傾向性是指客戶參與特定程序的傾向性。)
- Propensity score weighting: Weigh the data based on the propensity scores. Add larger weight to individuals who are underrepresented in the sample and a lower weight to those who are over-represented. Then analyze the weighted sample. (This is the method that we actually use in the current example.) 傾向得分加權:根據傾向得分對數據進行加權。 給樣本中代表性不足的個體增加較大的權重,為樣本過多的個體增加較小的權重。 然后分析加權樣本。 (這是我們在當前示例中實際使用的方法。)
In additional to the above traditional approaches for average treatment effect, a core problem that arises in data-driven personalized decision scenarios is the estimation of heterogeneous treatment effects: What is the effect of an intervention on an outcome of interest as a function of a set of observable characteristics of the treated sample? More and more techniques at the intersection of econometrics and machine learning are gaining popularity to tackle the problem of heterogeneous treatment effect estimation. Those methods offer flexibility in modeling effect heterogeneity, while at the same time leveraging techniques from causal inference and econometrics to preserve the causal interpretation of the learned model and usually also offer statistical validity via the construction of valid confidence intervals. The Microsoft Research ALICE team has developed a Python library called EconML, which is a collection of state-of-the-art techniques under a common API, for the estimation of heterogeneous treatment effects from observational data via machine learning. We utilize approaches from this package such as meta learners and double machine learnings for investment recommender.
除了上述傳統的平均治療效果方法之外,在數據驅動的個性化決策場景中出現的核心問題是對異構治療效果的估計:干預對目標結果的影響是一組的函數處理樣品的可觀察特征? 計量經濟學和機器學習相交的越來越多的技術正逐漸普及,以解決異構治療效果估計的問題。 這些方法提供了建模效果異質性的靈活性,同時利用因果推理和計量經濟學的技術來保留對學習模型的因果解釋,并且通常還通過構造有效的置信區間來提供統計有效性。 微軟研究院的ALICE團隊已經開發了一個名為EconML的Python庫,該庫是通用API下的最新技術的集合,用于通過機器學習從觀測數據中評估異構處理效果。 我們利用此軟件包中的方法,例如元學習者和雙重機器學習作為投資推薦者。
Ultimately, causal inference is an approach to reach a conclusion where we can state “we controlled for all the important features that could confound results, enough so that you can interpret the results as if a controlled experiment was run.” That, in itself, is a high bar and requires a deep understanding of the business context, our customers, and how customers use our services. However, it is required in order to remove the typical selection bias that otherwise exists when comparing customer populations who participated in a program versus those who did not.
最終,因果推理是一種得出結論的方法,在該結論中,我們可以聲明“我們控制了所有可能混淆結果的重要特征, 因此您可以像運行受控實驗一樣解釋結果 。” 這本身就是一個很高的標準,需要深入了解業務環境,我們的客戶以及客戶如何使用我們的服務。 但是,為了消除在比較參加計劃的客戶群體與未參加計劃的客戶群體時否則存在的典型選擇偏差,這是必需的。
Another challenge we face in these types of problems is determining whether our causal diagram is complete, and reflecting on “what we know” versus “what we don’t know” regarding the mechanisms leading to our desired outcome. One effective technique we’ve found is to test model performance by using the placebo treatment as explained in the refutation methods section of the DoWhy package by Amit Sharma, Emre Kiciman, et al., “DoWhy: A Python package for causal inference,” 2019. Essentially, we modify the dataset by randomly switching customers’ treatment programs and observe the impact on the model results. This shows us how sensitive the model is to the feature and indicates that our treatment variables have a significant impact on the model outcome.
在這些類型的問題中,我們面臨的另一個挑戰是確定因果圖是否完整,并在導致期望結果的機制上反思“我們知道”與“我們不知道”。 我們發現一種有效的技術是使用安慰劑治療來測試模型的性能,如Domit包的反駁方法部分( 由Amit Sharma,Emre Kiciman等人撰寫的“ DoWhy:用于因果推理的Python包”)所述。 2019年 本質上,我們通過隨機切換客戶的處理程序來修改數據集,并觀察對模型結果的影響。 這向我們展示了模型對特征的敏感程度,并表明我們的治療變量對模型結果具有重大影響。
歸因洞察力帶動行動 (Driving action with attribution insights)
In data science, ultimately we don’t want to just produce data points, we want to drive decisions and actions. So, what can we actually do with this attribution work? Of course, if we find that one program is more effective than another, we may choose to modify our program investments to invest more in higher ROI activities. However, more often we find that we want to use this data to improve our existing programs.
在數據科學中,最終我們不想只產生數據點,而是要推動決策和行動。 那么,我們實際上可以做些什么? 當然,如果我們發現一個計劃比另一個計劃更有效,我們可以選擇修改計劃投資,以更多地投資于更高的ROI活動。 但是,更多時候我們發現我們想使用這些數據來改進我們現有的程序。
For example, we can explore the ROI of a program by geography (or various other dimensions) in order to learn where it’s working better (versus worse) and then dig in further to understand why. Here is an example of a program, where we analyze the ROI for customers, by geo:
例如,我們可以按地理位置(或其他各種維度)來探索某個程序的投資回報率,以了解該程序在哪里工作得更好(相對于更糟),然后進一步挖掘原因。 這是一個程序示例,其中我們按地理位置分析了客戶的投資回報率:

In the multi-attribution scenario, we can also conduct “path analysis” to learn which combinations, durations, and orders of programs are most effective. In the example below, we find that a particular (sample) program yields maximum ROI at seven months of duration. This insight can help inform how long we engage (although we may still choose to continue engaging after the ROI peak, if the program continues to have enough impact):
在多屬性場景中,我們還可以進行“路徑分析”以了解哪種組合,持續時間和節目順序最有效。 在下面的示例中,我們發現一個特定的(示例)程序在七個月的時間里可獲得最大的ROI。 這種見解可以幫助告知我們參與的時間(盡管如果該計劃繼續產生足夠的影響,我們仍可以選擇在ROI達到峰值后繼續參與):

Another useful perspective is to consider the combination and sequencing of investments. In the example below we see that investments B and C are most effective when they’re used in combination together, and even more so when they are preceded by A:
另一個有用的觀點是考慮投資的組合和順序。 在下面的示例中,我們看到,將投資B和C結合在一起使用時最有效,而在A后面加上A則更有效:

Using this dataset, we also turn our descriptive analytics into predictive analytics and build recommendation models. In one scenario, we develop a “program-level” model to predict which customers will benefit most from a particular program. Using this model, we’re able to provide the program owners with a sorted list of potential customers, as well as “model explanation” details, summarizing the factors that led to each customer’s recommendation.
使用此數據集,我們還將描述性分析轉變為預測性分析并建立推薦模型。 在一種情況下,我們開發了一種“程序級”模型來預測哪些客戶將從特定程序中受益最大。 使用此模型,我們可以為計劃所有者提供潛在客戶的排序列表以及“模型說明”詳細信息,以匯總導致每個客戶推薦的因素。
We also construct a “customer-level” model to recommend which program a customer would benefit from most, next. (Of course, this also requires program capacity.) The figure below shows an example of the “customer-level” model, where we recommend treatment C for the customer and predict how much the customer will grow with the treatment (beyond the otherwise projected baseline).
我們還構建了一個“客戶級”模型,以推薦下一個客戶將從大多數程序中受益的程序。 (當然,這也需要程序容量。)下圖顯示了“客戶級別”模型的示例,在該模型中,我們為客戶推薦治療C,并預測該治療將使客戶增長多少(超出了其他預期的范圍)基準)。

進一步閱讀:歸因建模的歷史 (Further reading: A history of attribution modeling)
Those interested in data-driven attribution modeling might be interested in the following resources, which have been important research contributions to this field:
那些對數據驅動的歸因建模感興趣的人可能對以下資源感興趣,這些資源是該領域的重要研究貢獻:
Shao and Li (2011) developed a bagged logistic regression model to predict how investments from different programs lead to conversion or revenue uplift. One potentially limiting assumption in their models is that investments have the same effect regardless of their order (i.e. whether they were the first investment that the consumer received or the tenth).
Shao and Li(2011)開發了一種袋裝邏輯回歸模型,以預測不同計劃的投資如何導致轉化或收入增加。 在他們的模型中,一個潛在的限制性假設是,無論其順序如何,投資都具有相同的效果(即,它們是消費者獲得的第一筆投資還是第十筆)。
Dalessandro et al. (2012) extended this research by incorporating the sequence of investments that lead consumers to their final conversion status or revenue uplift.
Dalessandro等。 (2012)擴展了這項研究,納入了導致消費者達到最終轉化狀態或收入增長的投資順序。
Li and Kannan (2014) used a Bayesian framework to understand how consumers interact with a firm using different online channels. One of the findings of their experiment is that online channels exhibit significant carryover and spillover effects among themselves.
Li和Kannan(2014)使用貝葉斯框架來了解消費者如何使用不同的在線渠道與公司互動。 他們實驗的發現之一是,在線渠道之間相互之間表現出顯著的結轉和溢出效應。
Wiesel et al. (2011) considered the applied nature of the literature and focused on methodologies that can easily be implemented by marketers and financiers to perform attribution.
Wiesel等。 (2011年)考慮了文獻的應用性質,并側重于營銷商和金融家可以輕松實施以進行歸因的方法。
Ron Berman (2018) proposed a game theory approach to analytically devise allocation and payment rules for multi-channel ads, in his article “Beyond the Last Touch: Attribution in Online Advertising.”
羅恩·伯曼(Ron Berman(2018))在他的文章“超越最后一觸:在線廣告中的歸因”中提出了一種博弈論方法,以分析性地設計多渠道廣告的分配和支付規則。
結論 (Conclusion)
In this post, we’ve shared causal inference methods for determining whether a customer nurture activity caused a specific desired result. We also explored applications including recommendation models, that data scientists can use to make these insights actionable for the business. We hope these examples can be helpful for your work as well. Please leave a comment to share your attribution scenarios and the techniques you use today.
在這篇文章中,我們共享了因果推理方法來確定客戶的培育活動是否導致了特定的預期結果。 我們還探索了包括推薦模型的應用程序,數據科學家可以使用這些模型來使這些見解對企業可行。 我們希望這些示例也可以對您的工作有所幫助。 請發表評論,分享您的歸屬情況和您今天使用的技術。
I’d like to acknowledge Saptarshi Chaudhuri, Shijing Fang, Saurabh Kumar, and Deepsha Menghani, who have been significant contributors to this work.
我要感謝 Saptarshi Chaudhuri , Shijing Fang , Saurabh Kumar 和 Deepsha Menghani ,他們是這項工作的重要貢獻者。
翻譯自: https://medium.com/data-science-at-microsoft/attribution-analysis-how-to-measure-impact-part-2-of-2-606ab0ff017f
歸因分析
本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。 如若轉載,請注明出處:http://www.pswp.cn/news/391409.shtml 繁體地址,請注明出處:http://hk.pswp.cn/news/391409.shtml 英文地址,請注明出處:http://en.pswp.cn/news/391409.shtml
如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!