<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Michael Klaput on Medium]]></title>
        <description><![CDATA[Stories by Michael Klaput on Medium]]></description>
        <link>https://medium.com/@michael_63632?source=rss-c5e721e0bfda------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*3ufq-dvC2iW88G3I</url>
            <title>Stories by Michael Klaput on Medium</title>
            <link>https://medium.com/@michael_63632?source=rss-c5e721e0bfda------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 07:49:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@michael_63632/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why Analytics Needs an Impact-Driven Approach]]></title>
            <link>https://medium.com/data-science/why-analytics-needs-an-impact-driven-approach-43179f3bec4e?source=rss-c5e721e0bfda------2</link>
            <guid isPermaLink="false">https://medium.com/p/43179f3bec4e</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-driven-business]]></category>
            <category><![CDATA[decision-intelligence]]></category>
            <category><![CDATA[impact-driven-analytics]]></category>
            <dc:creator><![CDATA[Michael Klaput]]></dc:creator>
            <pubDate>Thu, 10 Nov 2022 02:13:01 GMT</pubDate>
            <atom:updated>2022-11-10T02:13:01.946Z</atom:updated>
            <content:encoded><![CDATA[<h4>The amount of data and its complexity are rising constantly, making it harder and more expensive for businesses to find the right places to create value and drive impact</h4><figure><img alt="Image by rawpixel.com on Freepik" src="https://cdn-images-1.medium.com/max/1024/1*uU6iaRLzXA7WkMkvvkoo9A.jpeg" /><figcaption>Image by <a href="http://rawpixel.com/">rawpixel.com</a> on Freepik.</figcaption></figure><p>When your marketing team is running thousands of campaigns in different regions, countries, and platforms, there are millions of hypotheses that can be tested and numerous interventions that can be made. Or there are hundreds of different touch-points in a website that might be affecting the way consumers engage or churn and it differs for each consumer segment.</p><h3>Constantly chasing why metrics change</h3><p>This means that your metrics such as return on ad spend, conversion rate, or basket size are changing on a regular basis. But do you know <em>why they are changing?</em> Do you know what to do in order to move the needle in your favour? If you want to create impact, new learnings need to be implemented in your marketing and sales efforts every day. Even for well-performing efforts, failing to track and make incremental changes could result in downturn in the longer run.</p><p>Using traditional business intelligence tools means that you need to know the right question to ask to get started. And it can be both frustrating and time-consuming even to identify the right question. While business teams throw different questions at data teams hoping to identify the reason for metrics changes, data teams are overwhelmed with the requests. And more often than not, by the time the right question and the root causes are found, it is too late to act on it, missing the window to create value.</p><h3>A new approach is needed</h3><p>To get to the why, businesses need speed and scale to be able to transform through data, a way to reduce time to insights from weeks to minutes, and an accurate view of priorities to empower team members to focus on what really matters.</p><p>This is where the power of machine learning comes into play:</p><ul><li>Every possibility is analysed within minutes,</li><li>actionable insights are put into business teams’ hands in real-time, and</li><li>no opportunities are left on the table.</li></ul><p>Given that the abundance of data will only get greater, businesses, especially the ones in fast-growing and fragmented markets, need to navigate this complexity well and fast to stay competitive.</p><h3>A high level view is informative, but not yet actionable</h3><p>Let’s take a look into our international, cross-platform campaign example and assume that you are seeing a global uplift of 47% in ROI (see Figure 1). That’s an impressive outcome, but to keep up the performance, you need to diagnose what is driving this increase.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FCznqS%2F3%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FCznqS%2F3%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FCznqS%2Fplain-s.png%3Fv%3D3&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0366eed1b74675c04569828d627d19fa/href">https://medium.com/media/0366eed1b74675c04569828d627d19fa/href</a></iframe><p>When analysing the ROI of this campaign, what if you could understand how much <em>every sub-campaign or sub-segment contributes to the ROI</em> of your global marketing efforts within seconds? And you could easily view the information <em>around the platforms, countries and demographics to have a better context?</em> What if you could even cross-check the change in ROI with the changes in other <em>related metrics such as CPI, predicted revenue, or in-app conversions</em>?</p><p>I’m sure you agree that this would be great, but you may be thinking: “<em>Can’t I do this already today in my dashboards?</em>” In fact, no… Because dashboards are great at showing you changes, but they don’t help you see how it all fits together.</p><h3>Turning to dashboards for analysis and identifying the next course of action could be misleading</h3><p>Let’s take a look at Figure 2 below, where you can see a simple visualization of ROI change by country. You are most likely going to direct your attention to <em>Finland, Ireland, and Spain</em> as they have the steepest changes. What if I were to tell you that the <em>main contributors to the Global ROI are actually Croatia, Austria, and Belgium,</em> while Finland is actually one of the smallest contributors?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2F21Jc4%2F3%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2F21Jc4%2F3%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2F21Jc4%2Fplain-s.png%3Fv%3D3&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="520" height="570" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff9c2a3c03131ff8f4e362114b2921d3/href">https://medium.com/media/ff9c2a3c03131ff8f4e362114b2921d3/href</a></iframe><p>As Figure 2 didn’t take into account the <em>size of the marketing spend and revenue change</em>, it diverted your attention, instead of focusing it on the high-impact countries. Looking at individual changes loses track of how much each piece really moves the needle for your business. When you do take the full picture into account, you can understand by how much each country has been pulling the global ROI up or down. We have summarised the results of such an analysis in Figure 3 below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FzeOpi%2F2%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FzeOpi%2F2%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FzeOpi%2Fplain-s.png%3Fv%3D2&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="650" height="691" frameborder="0" scrolling="no"><a href="https://medium.com/media/e273161e63229ecfeb1e92a7e0dcd1bb/href">https://medium.com/media/e273161e63229ecfeb1e92a7e0dcd1bb/href</a></iframe><h3>True insights are generated with impact in mind</h3><p>Working on a small set like this, similar insights can be found through manual slicing and dicing as teams will know the usual suspects to go after, but this becomes impossible as datasets grow, more factors and subfactors come into play and performance comparisons over time are needed. <em>Depending on gut feeling will only lead to missed opportunities or lost savings.</em></p><p>Just because you have complex data, working with it doesn’t have to be complex as well. Decision intelligence platforms powered by machine learning can help to simplify and automate your data processes. This means:</p><ul><li><strong>your business</strong> teams will get informed of potential opportunities within minutes, and</li><li><strong>your data teams</strong> are freed from manual slicing and dicing as well as ad-hoc requests and are able to concentrate on strategic priorities and take on a proactive role</li><li><strong>your analysts</strong> are empowered to deliver insights that focus your team’s attention to what really matters</li></ul><h3>About the author</h3><p><em>Michael Klaput</em> is Co-Founder and Chief Technology Officer of Kausa.</p><p><a href="http://www.kausa.ai/"><em>Kausa</em></a><em> accelerates data exploration, delivering actionable insights in seconds by testing all hypotheses comprehensively and continuously. You can read more on </em><a href="http://www.kausa.ai/"><em>the website</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43179f3bec4e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/why-analytics-needs-an-impact-driven-approach-43179f3bec4e">Why Analytics Needs an Impact-Driven Approach</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How causal inference lifts augmented analytics beyond flatland]]></title>
            <link>https://medium.com/data-science/how-causal-inference-lifts-augmented-analytics-beyond-flatland-95648fe30055?source=rss-c5e721e0bfda------2</link>
            <guid isPermaLink="false">https://medium.com/p/95648fe30055</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[notes-from-industry]]></category>
            <category><![CDATA[editors-pick]]></category>
            <dc:creator><![CDATA[Michael Klaput]]></dc:creator>
            <pubDate>Fri, 02 Jul 2021 16:16:00 GMT</pubDate>
            <atom:updated>2021-07-12T13:53:34.395Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsdatascience.com/tagged/notes-from-industry">Notes from Industry</a></h4><h4><em>Causal inference techniques along with business analytics approaches unravel what truly changes your KPIs, while predictive modeling falls flat.</em></h4><p>If the world was two-dimensional, life would be very odd indeed. Think about it: The earth would not be a sphere but a circle — just like all other stars and planets in a 2D universe. Beings would be flattened, too, navigating a plane landscape and existence. For example, to pass somebody on the street, you would have to jump over that person as there would be no depth whatsoever. For the same reason, to just look behind you, you would literally have to turn yourself upside down. Fortunately, this is not the world we live in. But unfortunately, this is the basis on which most enterprises are run today — perhaps even yours. In any technology-driven business, the quality of your Decision-making is inevitably based on the quality of your data insights. However, in too many companies, those ’insights’ are effectively two-dimensional: flat, impractical, and hopelessly inconclusive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*7v_FbcIMYWYCa0vNkPssOg.png" /><figcaption>Super Mario</figcaption></figure><p>Businesses usually measure their performance in terms of a KPI. It has thus become an objective in data analytics to find the best predictive models of future KPI values given historical data. While these models might perform surprisingly well, extracting value out of them is just as hard. Aside from a lack of explainability, this is also because predictive models are unable to capture reality and are limited to low-dimensional explanations. In this article, we will give two arguments why this is the case based on bad scaling and unrealistic assumptions made in most predictive models.</p><p>But why bother? It is not the well-performing model that improves business performance. Instead, the only way to improve a business is through decisions, which should ultimately be done by a human. The objective of data analytics in business should be to inform decisions by uncovering insights. Unfortunately, these are hidden in your data like needles in a haystack. This far from trivial problem motivated a relatively young branch of data analytics has been coined augmented analytics and has been pushed in a recent Gartner report [1].</p><p>We want to challenge the perception that predictive models should be the default option used to inform business decisions. They introduce a costly detour in the search for insights, and might even render it practically infeasible. We will highlight in a simple problem that predictive modeling can offer only little aside from a massive overhead. Instead, we will try to mimic how a business analyst would operate. This will naturally bring us to methods from causal inference.</p><h3>The Impactful Change</h3><p>We will consider the problem of diagnosing errors in regression models in big data scenarios. Most of the readers should have encountered the following scenario:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2F84jPr%2F2%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2F84jPr%2F2%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="735" height="393" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c9706399a301f24b6152709022f2a10/href">https://medium.com/media/7c9706399a301f24b6152709022f2a10/href</a></iframe><p>Clearly, there has been an impactful change in the KPI that seems to persist for the time being. On the technical side, a reasonable reaction would be to retrain your predictive model on the data after the change point. Do you agree? If so, maybe keep this in mind.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FaoC4x%2F2%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FaoC4x%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/62dd872ca5873dff3e8a825541f1de0c/href">https://medium.com/media/62dd872ca5873dff3e8a825541f1de0c/href</a></iframe><p>The good news is that your model seems to be accurate. The bad news is that your manager will inevitably ask what happened to the KPI. But do not be afraid. This is an ideal situation for proving your value to the company. Can you identify the reason behind this change? Can you uncover insights that will inform the correct decision?</p><h3>The Quest of Why</h3><p>Let’s say your company’s dataset looks something like this:</p><pre>import pandas as pd<br>df = pd.read_csv(“..\\dataset\\ecommerce_sample.csv”)<br>df.head()</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FcFX2K%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FcFX2K%2F1%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="800" height="456" frameborder="0" scrolling="no"><a href="https://medium.com/media/d345c6db76b33813f81d41b3787104b1/href">https://medium.com/media/d345c6db76b33813f81d41b3787104b1/href</a></iframe><p>Let us further assume that you are dealing with the simplest case: The KPI values of data points before and after the jump are perfectly fit using a linear regression model. Here, you are dealing with categorical data which you need to handle appropriately to use in the regression. A standard approach for this is one-hot encoding of categorical values: for each category value, you introduce a feature that can be either true or false. For example, in the dataset above you would define the feature <em>customer_country == Germany</em>. To finally enable feature selection, it is necessary to use a form of regularisation. Here, you will use lasso regularisation (with ten-fold cross-validation).</p><p>After training two Lasso regularized linear regression models, one before and one after the jump, you can look at a ranked list of feature weight differences between these.</p><pre>from sklearn.linear_model import LassoCV<br>from bokeh.io import show<br>from bokeh.plotting import figure</pre><pre>#get kpi_axis<br>kpi_axis = ‘kpi’<br>time_axis = ‘time’<br>df[time_axis] = pd.to_datetime(df[time_axis],format = ‘%d/%m/%Y’)<br>y_before = df[df[time_axis] &lt;= ‘2019–09–11’][kpi_axis]<br>y_after = df[df[time_axis] &gt; ‘2019–09–11’][kpi_axis]</pre><pre>#one-hot encoding categorical features<br>for col in df.drop([kpi_axis,time_axis],axis=1).columns:<br>   one_hot = pd.get_dummies(df[col])<br>   df = df.drop(col,axis = 1)<br>   df = df.join(one_hot)</pre><pre>X_before = df[df[time_axis] &lt;= ‘2019–09 11’].drop([kpi_axis,time_axis],axis = 1).to_numpy()<br>X_after = df[df[time_axis] &gt; ‘2019–09–11’].drop([kpi_axis,time_axis],axis = 1).to_numpy()</pre><pre>#training left and right<br>regression_model_before = LassoCV(cv = 10)<br>regression_model_after = LassoCV(cv = 10)<br>regression_model_before.fit(X_before,y_before)<br>regression_model_after.fit(X_after,y_after)</pre><pre>#plotting results<br>features = df.columns<br>dweights =regression_model_after — regression_model_before<br>index = np.argsort(-abs(dweights))<br>x_axis = features[index[0:3]].to_list()</pre><pre>p = figure(x_range=x_axis,title = “Feature weights difference”,plot_width=1000)<br>p.vbar(x=x_axis, top=(abs(dweights[index[0:3]])),width = 0.8)<br>show(p)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FuX53Y%2F2%2F&amp;display_name=Datawrapper&amp;url=http%3A%2F%2Fdatawrapper.dwcdn.net%2FuX53Y%2F2%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="672" height="240" frameborder="0" scrolling="no"><a href="https://medium.com/media/eed24b2e8f06af5fc0149687e22b5034/href">https://medium.com/media/eed24b2e8f06af5fc0149687e22b5034/href</a></iframe><p>It looks like subgroups such as android customers or customers older than 46+ performed differently before and after the jump. Great, looks like you found the reasons for the KPI jump … or did you?</p><h3>The Curse of Dimensionality</h3><p>In fact, this is a more non-trivial situation than we have appreciated so far. Imagine presenting this to the KPI owner. They will be very happy that you have delivered them reasons for the KPI change and they will now be wondering about what to do based on this information. It will automatically lead them to questions like the following: “<em>Are the actual drivers for the KPI change all android-tv customers, all customers older 46, and all customers who made a purchase before? Maybe it could be the repeat customers older than 46 and the android-tv customers … or the android-tv customers who purchased something before? Worse, are there maybe other combinations of features which you have missed?</em>”</p><p>Therefore, to be able to more confidently answer such questions, you would have to repeat your regression analysis with more complex one-hot encoded features … now representing finer subgroups than before. Thereby, you are searching among deeper subgroups of the dataset, see Fig. 4, with new features like <em>customer_age == 46+ AND first_order_made == yes, customer_age == 18–21 AND first_order_made == no.</em></p><p>Again these subgroups enter via one-hot encoding. This is obviously problematic, as you are now falling victim to the <em>curse of dimensionality</em>. It is the era of big data, and you just increased your number of features by a factorial amount [2]. A piece of code that can be used to generate these refined subgroups is</p><pre>def binarize(df,cols,kpi_axis,time_axis,order):<br>   cols = cols.drop([kpi_axis,time_axis])<br>   features = []<br>   for k in range(0,order):<br>      features.append(cols)<br>   fs = []<br>   for f in itertools.product(*features):<br>    # list(set(f)).sort()<br>      f = np.unique(f)<br>      fs.append(tuple(f))<br>   fs = tuple(set(i for i in fs))<br>   print(fs)<br>   for f in fs:<br>      print(len(f))<br>      states =[]<br>      for d in f:<br>         states.append(tuple(set(df[d].astype(‘category’))))<br>      for state in itertools.product(*states):<br>         z = 1<br>         name = str()<br>         for d in range(0,len(f)):<br>            z = z*df[f[d]]==state[d]<br>            name += f[d] + “ == “ +str(state[d])<br>            if d&lt;len(f)-1:<br>               name += “ AND “<br>         df[name] = z<br>   for d in cols:<br>      df = df.drop([d],axis = 1)<br>   return df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*AXLHc45Ll77VYlB3UzoYdA.png" /><figcaption>Figure 4 — Subgroup depth</figcaption></figure><p>Remember that linear regression is based on an inversion of a covariance matrix among all features — which scales O(d³), with d being the number of features, i.e. in our case the number of possible subgroups. This introduces significant opportunity cost in comparison to non-predictive feature selection methods — as will be discussed later.</p><pre>df = pd.read_csv(“..\\dataset\\ecommerce_sample.csv”)<br>df[time_axis] = pd.to_datetime(df[time_axis],format = ‘%d/%m/%Y’)</pre><pre>#get kpi_axis<br>kpi_axis = ‘kpi’<br>time_axis = ‘time’<br>y_before = df[df[time_axis] &lt;= ‘2019–09–11’][kpi_axis]<br>y_after = df[df[time_axis] &gt; ‘2019–09–11’][kpi_axis]</pre><pre>#one-hot encoding categorical features<br>df = binarize(df,df.columns,kpi_axis,time_axis,3)<br>X_before = df[df[time_axis] &lt;= ‘2019–09–11’].drop([kpi_axis,time_axis],axis = 1).to_numpy()<br>X_after = df[df[time_axis] &gt; ‘2019–09–11’].drop([kpi_axis,time_axis],axis = 1).to_numpy()</pre><pre>#training left and right<br>regression_model_before = LassoCV(cv = 10)<br>regression_model_after = LassoCV(cv = 10)<br>regression_model_before.fit(X_before,y_before)<br>regression_model_after.fit(X_after,y_after)</pre><pre>#plotting results<br>features = df.columns<br>dweights =regression_model_after — regression_model_before<br>index = np.argsort(-abs(dweights))<br>x_axis = features[index[0:3]].to_list()</pre><pre>p = figure(x_range=x_axis,title = “Feature weights difference”,plot_width=1000)<br>p.vbar(x=x_axis, top=(abs(dweights[index[0:3]])),width = 0.8)<br>show(p)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FDA3MD%2F4%2F&amp;display_name=Datawrapper&amp;url=http%3A%2F%2Fdatawrapper.dwcdn.net%2FDA3MD%2F4%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="672" height="213" frameborder="0" scrolling="no"><a href="https://medium.com/media/eee7ece997c8665870a9e7ef9e479d3b/href">https://medium.com/media/eee7ece997c8665870a9e7ef9e479d3b/href</a></iframe><p>After some time your computation finishes. While your earlier computation took just 0.1 seconds, searching for third-order features already took over a minute. But it seems to be worth it. You find that the number of groups driving the KPI change was actually one, see Fig.5. Presenting this insight to your manager, he could quickly point to an update that directly affected the subgroup you reported.</p><blockquote>- By refining the subgroup, you could render it actionable.</blockquote><p>While your regression approach finally worked out — it took extremely long to compute resulting in opportunity cost to your company. In a realistic scenario of big data, your approach would have failed horribly. Additionally, original sets containing only shallow subgroups painted an incorrect picture. Only after refining sets and enormous computational effort, you could pinpoint the actual subgroup that drove the jump in the KPI.</p><p>This begs a couple of questions:</p><ul><li>Do you actually need to learn a predictive model to answer why the jump happened?</li><li>How can you reduce opportunity costs?</li><li>How can you find subgroups at the appropriate level of granularity?</li><li>Is it economic to retrain models at every jump for this piece of information?</li></ul><p>While answering all these questions is out-of-scope for this post, we will offer a new point-of-view that can help to resolve these issues. For this, we will develop an approach to feature selection that improves on linear regression. Augmented analytics depends on it.</p><h3>Learning from Business Analysts and Causal Inference</h3><p>Let’s take a step back … what happened here? You started off with a predictive model, and you saw that it could neither predict nor explain the observed jump in the KPI. Why is that? Because predictive models are unable to capture reality. They assume that all data is independently and identically distributed [3]. However, in real-life applications, this is often incorrect, as this example shows. Data before and after the jump was generated under different conditions. You even intuitively made use of this fact, when you used two separate predictive models which (after some tricks) helped us to uncover the reason for that jump.</p><p>As you had to give up on prediction and ultimately did not predict anything, what did the prediction models actually do for you? If you think about it, the key is that you are not interested in predicting the KPI as a function of all possible subgroups — you are interested in subgroups affecting the KPI! Thus, to search for insights at deeper levels you have to get away from predictive modeling. This is where the data scientist can learn from the business analyst.</p><p>A business analyst searches for insights through dashboards containing meaningful summaries of data. Instead of correlating all features together, as in the regression approach above, the business analyst will try to pinpoint what changes happened in the data based on summaries (like means, histograms, or metrics) by iteratively filtering the data for different conditions. Most importantly, the business analyst will never have to look at all features at once. How do you teach a machine to do that? How can you learn from a business analyst?</p><p>Let us formalize the above in mathematical notation. Let X be a subgroup, e.g. <em>X = customer_age == 46+ AND first_order_made == yes </em>and</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/164/1*aM2Y63NJe0T0aLhzlSNcrQ.gif" /></figure><p>some summary of the KPI distributions before and after the jump in the KPI. Then, you introduce conditional summaries</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*eA06k7A83mlGLXbg7JUOkw.gif" /></figure><p>where you compute summaries of subsets of KPI values for which X is true. All that our method needs to do now, is to compute conditional summaries for each subgroup and rank them. I want to stress, that in practice these abstract summaries can be objects as means, histograms e.t.c.</p><p>The procedure detailed above is actually a common technique from causal inference [4]. You thereby implicitly changed our point of view. Now, you consider the mysterious jump in the KPI as an intervention, that is now assumed to have happened due to external or internal <em>treatments</em>. An example for an external treatment might be the holiday season, an internal treatment might be an ad campaign, a change in pricing, or, as in our case a software update. You are thus explicitly <em>lifting </em>the wrong assumption that all data is independently and identically distributed. You are now searching for subgroups that are <em>causal</em> to the change in KPI.</p><h3>The Quest of Why — Revisited</h3><p>Now that you have a model of how a business analyst operates, let us proceed with the actual implementation. For now, you will use a standard summary used in causal inference called Conditional Average Treatment Effect (CATE) [4], for which our summary becomes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*rRA8u7gok0BAYBo8kX8cyg.gif" /></figure><p>The CATE corresponds to the change in the mean of the KPI, conditioned on that subgroup X is true. Ranking by magnitude then gives us the correct subgroup as a result. To detect multiple subgroups, we repeat this procedure after removing the best performing subgroup after each iteration:</p><pre>df = pd.read_csv(“..\\dataset\\ecommerce_sample.csv”)<br>df[time_axis] = pd.to_datetime(df[time_axis],format = ‘%d/%m/%Y’)</pre><pre>#get kpi_axis<br>kpi_axis = ‘kpi’<br>time_axis = ‘time’<br>y_before = df[df[time_axis] &lt;= ‘2019–09–11’][kpi_axis]<br>y_after = df[df[time_axis] &gt; ‘2019–09–11’][kpi_axis]</pre><pre>df = binarize(df,df.columns,kpi_axis,time_axis,3)<br>df_before = df[df[time_axis] &lt;= ‘2019–09–11’]<br>df_after = df[df[time_axis] &gt; ‘2019–09–11’]<br>features = copy(df.drop([time_axis,kpi_axis], axis=1).columns)</pre><pre>K = 3 #number of subgroups to detect<br>subgroups=[]<br>score=[]<br>for k in range(0,K):<br>   CATE = []<br>   y_before = df_before[kpi_axis]<br>   y_after= df_after[kpi_axis]</pre><pre>#compute CATEs for all subgroups<br>   for d in features:<br>      g = df_before[d] == True<br>      m_before = np.mean(y_before[g])<br>      g = df_after[d] == True<br>      m_after = np.mean(y_after[g])<br>      CATE.append(m_after-m_before)</pre><pre>#find subgroup with biggest CATE<br>   index = np.argsort(-abs(np.array(CATE)))<br>   subgroups.append(features[index[0]])<br>   score.append(abs( CATE [index[0]]))</pre><pre>#remove found subgroups from dataset<br>   df_before = df_before[df_before[features[index[0]]] == False]<br>   df_after = df_after[df_after[features[index[0]]] == False]<br>   features = features.drop(features[index[0]])</pre><pre>p = figure(x_range=subgroups,title = “Conditional Average Treatment Effect”,plot_width=1200,)<br>p.vbar(x=subgroups, top=score,width = 0.8,color=’black’)<br>show(p)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2Fic1qz%2F2%2F&amp;display_name=Datawrapper&amp;url=http%3A%2F%2Fdatawrapper.dwcdn.net%2Fic1qz%2F2%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="606" height="213" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa344220df1db473c2f5fa7124389975/href">https://medium.com/media/aa344220df1db473c2f5fa7124389975/href</a></iframe><p>This takes a fraction of the cost of our predictive model. The computation for first-order features took just 0.02 seconds, searching for third-order features took less than a second.</p><p>Let us take a step back and compare this approach with the earlier one based on regression and what their respective objectives are. Feature selection via regression answers the question: ” Which subgroups best predict your KPI?”. While taking the view of causal inference answers the question: “Which subgroups had the biggest causal effect on the KPI?”. Comparing run-times of a naive implementation of CATE with the optimized <em>sklearn</em> implementation of linear regression in Fig. 7, we find that they lie order of magnitudes apart. This makes it clear that these questions, while superficially similar, have fundamental differences.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FhqATv%2F1%2F&amp;display_name=Datawrapper&amp;url=http%3A%2F%2Fdatawrapper.dwcdn.net%2FhqATv%2F1%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b9ba894270dceb990fd8c3b468bacf5/href">https://medium.com/media/8b9ba894270dceb990fd8c3b468bacf5/href</a></iframe><h3>Conclusion</h3><p>Predictive models have strong shortcomings as means to understand KPI changes, especially in multi-dimensional contexts. These models fundamentally answer the wrong questions under the wrong assumptions. Instead, business analytics focuses on why did something happen rather than what will happen. Having their mind free of the auxiliary task of predicting future KPI values, analytics finds reasons in the data to understand why the KPI changed, trying to find the answers for the right question.</p><p>Be wary next time you want to explain anything. Firstly, you should ask the right question. In addition, multi-dimensional contexts require a scalable technique based on causal inference and business analytics methods. This is our mission at <a href="http://www.kausa.ai/">Kausa</a>: scale business analytics logic and couple it with causal inference to provide the right answers to KPI changes.</p><p><em>PS: Code and data to reproduce results from this article are available at [6].</em></p><h3>About the authors and Kausa</h3><p><em>Michael Klaput</em> is Co-Founder and Chief Technology Officer and <em>Dominik Linzner</em> is Causal Inference Engineer at <a href="http://www.kausa.ai/">Kausa</a>.</p><p><a href="http://www.kausa.ai/"><em>Kausa</em></a><em> accelerates data exploration, delivering actionable insights in seconds by testing all hypotheses comprehensively and continuously. </em><strong><em>Interested in trying out the product? </em></strong><a href="http://www.kausa.ai/"><strong><em>Sign up for the early access queue</em></strong></a><strong><em>.</em></strong></p><h3>References</h3><ol><li><a href="https://www.gartner.com/en/doc/441420-how-augmented-analytics-will-transform-your-organization">How Augmented Analytics Will Transform Your Organization</a></li><li><a href="https://medium.com/swlh/stop-one-hot-encoding-your-categorical-features-avoid-curse-of-dimensionality-16743c32cea4">Stop One-Hot Encoding your Categorical Features — Avoid Curse of Dimensionality</a></li><li><a href="http://arxiv.org/abs/1911.10500">Schölkopf, B. (2019). Causality for Machine Learning. 1–20.</a></li><li><a href="http://proceedings.mlr.press/v67/gutierrez17a/gutierrez17a.pdf">Gutierrez, P., &amp; Gérardy, J.-Y. (2016). Causal Inference and Uplift Modeling A review of the literature (Vol. 67)</a></li><li><a href="https://towardsdatascience.com/be-careful-when-interpreting-predictive-models-in-search-of-causal-insights-e68626e664b6">Be Careful When Interpreting Predictive Models in Search of Causal Insights</a></li><li><a href="https://github.com/kausa-ai/blog/tree/master/how_causal_inference_lifts_augmented_analytics_beyond_flatland">Ecommerce dataset</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95648fe30055" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/how-causal-inference-lifts-augmented-analytics-beyond-flatland-95648fe30055">How causal inference lifts augmented analytics beyond flatland</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>