<?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 Ridhima Kumar on Medium]]></title>
        <description><![CDATA[Stories by Ridhima Kumar on Medium]]></description>
        <link>https://medium.com/@ridhima-kumar0203?source=rss-2a43d9badb6c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*x5irWdTIVied5xaHqi4WcA.jpeg</url>
            <title>Stories by Ridhima Kumar on Medium</title>
            <link>https://medium.com/@ridhima-kumar0203?source=rss-2a43d9badb6c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 08:41:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ridhima-kumar0203/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[ROBYN UNDER THE HOOD]]></title>
            <link>https://ridhima-kumar0203.medium.com/robyn-under-the-hood-6a06730ed9a5?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a06730ed9a5</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[advertising]]></category>
            <category><![CDATA[marketing-mix-modeling]]></category>
            <category><![CDATA[meta]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Wed, 10 Aug 2022 10:38:08 GMT</pubDate>
            <atom:updated>2022-08-10T10:38:08.061Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*rFAwBwMie_aG70OhKM5Hiw.png" /><figcaption>Image Source : <a href="https://en.wikipedia.org/wiki/Robin_Hood">Wikipedia</a></figcaption></figure><p>With Google pulling the plug on third party cookies in 2023 and data privacy regulations in place, most brands have been looking at other methods to measure their marketing effectiveness.</p><p>One such method which can aid marketers in creating effective strategies is Marketing Mix Modeling (MMM).</p><p>Market Mix Modeling (MMM) is a technique which helps in quantifying the impact of several marketing inputs on the KPI (e.g. Sales, Market Share, CTR etc.). The purpose of using MMM is to understand how much each marketing input contributes to the KPI, and how much to spend on each marketing input.</p><p>We have been requested by many to give our take on open-source libraries like Robyn.</p><p>We have been using our proprietary techniques + Robyn for some of our MMM projects.</p><p>We are starting a series “Robyn under the hood” to educate and inform MMM users across the globe on Robyn.</p><p>Through this series, we dig deep into the methods/ techniques used and try to answer the ‘How’ &amp; ‘Why’ behind these techniques like:</p><blockquote>· Why Robyn uses Ridge Regularization?</blockquote><blockquote>· Does Ridge reduce overfitting?</blockquote><blockquote>· What loss function is used?</blockquote><blockquote>· Why is Weibull distribution used for Adstock? Why not any other distribution?</blockquote><blockquote>· How Multi-objective optimization works for tuning hyper-parameters?</blockquote><blockquote>· What is Pareto optimality?</blockquote><p>To kick-off, we will first cover Ridge Regularization in Robyn.</p><p><strong>Robyn Under the Hood</strong></p><p>“Robyn is an experimental, semi-automated and open-sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. It uses various machine learning techniques (Ridge regression, multi-objective evolutionary algorithm for hyperparameter optimization, time-series decomposition for trend &amp; season, gradient-based optimization for budget allocation etc.) to define media channel efficiency and effectivity, explore adstock rates and saturation curves.”¹</p><p>Under the hood, Robyn uses Ridge regression to regularize multi-collinearity and automate hyper-parameter optimization using evolutionary algorithms from Facebook AI’s library Nevergrad. It also makes use of Facebook’s prophet library to decompose the time series into trend, seasonality and holidays.</p><p>So, first let’s do a drill down on Ridge Regression.</p><ol><li><strong>Ridge Regression:</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*oTIH9OGH_vM-P_gYZ7ppBg.png" /><figcaption>Source: <a href="https://www.statlearning.com/">An Introduction to Statistical Learning</a></figcaption></figure><p>Ridge Regression (depicted on the right hand size in the above image) is a regularization technique which helps combat overfitting in the model. For more detailed explanation on why Ridge Regression does not reduce the coefficients to zero, check out the resources <a href="https://online.stat.psu.edu/stat508/lesson/5/5.1">here</a> and <a href="https://stats.stackexchange.com/a/179865">here</a>.</p><p>There are some models which perform well on the training set but fail to perform on the test set. In other words, the model has poor predictive power when it comes to unseen data and is overfitted on the train set. To help combat this, regularization technique is applied which reduces the variance at the cost of adding a bias.</p><p>One such method is Ridge Regression.</p><p><strong>2.</strong> <strong>Why is Ridge regression used in MMM?</strong></p><p>It is very common to observe multicollinearity among different independent variables in MMM. This leads to model being overfitted. Through Ridge regression, a penalty term is introduced to the model cost function. The penalty term is the sum of squares of all the model coefficients multiplied by Lambda (λ). Refer to the equation below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*qX-Ex4b_r7KUQ73Cbi2YKg.png" /><figcaption>Source: <a href="https://facebookexperimental.github.io/Robyn/docs/features">Robyn</a></figcaption></figure><p>The penalty term penalizes the regression model and shrinks the coefficients towards zero. Here, lambda controls the severity of the penalty. Higher the value of λ, higher is the impact of shrinkage.</p><p>So, if there are too many variables in the model, the impact of some variables will be closer to zero. Ridge Regression does not remove predictors from the model, it just shrinks them towards zero (but does not make it zero). The coefficients are not exactly 0 and we can still see the impact of all the predictors in the model.</p><p><strong>3.</strong> <strong>Ridge Regression in Robyn</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*wjzRVxLBBVtqIfsBAXBYZQ.png" /><figcaption>Source: <a href="https://facebookexperimental.github.io/Robyn/docs/features">Robyn</a></figcaption></figure><p>In the next post, we will try to cover the functions responsible for implementing Ridge regression in Robyn.</p><p><strong>Resources:</strong></p><p>1. <a href="https://facebookexperimental.github.io/Robyn/docs/about">https://facebookexperimental.github.io/Robyn/docs/about</a></p><p>2. <a href="https://facebookexperimental.github.io/Robyn/docs/analysts-guide-to-MMM">https://facebookexperimental.github.io/Robyn/docs/analysts-guide-to-MMM</a></p><p>Want to implement Marketing Mix Models (MMM) and other Marketing Analytics Solutions?</p><p>Get in touch with us at:</p><p>Website: <a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a06730ed9a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cookieless winter Postponed !!]]></title>
            <link>https://ridhima-kumar0203.medium.com/cookieless-winter-postponed-a36d83b33dac?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a36d83b33dac</guid>
            <category><![CDATA[advertising]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[market-mix-modeling]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[marketing]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Tue, 02 Aug 2022 04:03:42 GMT</pubDate>
            <atom:updated>2022-08-02T04:03:42.062Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cookieless winter Postponed !!</h3><p>So, Google decided to postpone the sunsetting of cookies to 2024. Sigh.. I know, I can hear the anguish of ‘Not Again’ .</p><p>In fact just a few days ago, I had created a meme on how the cookieless winter is coming in 2023. Thanks to Google’s announcement I had to edit it. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*oFLl61EJFbHlmtokd5cOvg.png" /><figcaption>Credits :Self</figcaption></figure><p>As a fallout of this announcement from Google, Some of my clients and friends from AdTech/Martech messaged and asked me:</p><ul><li>What will be the effect of this postponement ?</li><li>How does it affect companies that has already started to implement MMM based solutions?</li><li>What happens to those who still have not figured out a non cookie based solution?</li></ul><p>So here is my take:</p><h4>The Head Start</h4><ul><li>Some companies started experimenting and implementing MMM based solutions as early as 2021 (just few months after Google had announced then that they would deprecate cookies by 2022). Not to mention, there are companies/agencies who have been implementing MMM for past 20–30 yrs. In my opinion, these companies have a huge head start vis a vis companies that are still figuring out solutions.</li></ul><h4><strong>The Taste of Privacy</strong></h4><ul><li>Some companies and their clients have had a sweet taste of the cookie free solutions like MMM. A taste of freedom in a sense. <br>For them going back to the cookie based solutions would be a downgrade of sorts.</li></ul><h4>2024 is not that far off</h4><ul><li>Some companies might be tempted to take their foot of the peddle thinking that 2024 is far away. From my experience, getting MMM based solutions ready, requires a lot of R&amp;D and experimentations. The more you experiment, the more quickly you will arrive at a good solution. So as the saying goes, “the best time to plant a tree was 20 yrs ago and the next best time is now”. Now would be the right time to experiment and adopt MMM solutions.</li></ul><p>Want to implement Marketing Mix Models (MMM) and other Marketing Analytics Solutions?</p><p>Get in touch with us at:</p><p>Website: <a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a36d83b33dac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Will the adoption of MMM and MTA increase or decrease given the looming macro economic conditions ?]]></title>
            <link>https://ridhima-kumar0203.medium.com/will-the-adoption-of-mmm-and-mta-increase-or-decrease-given-the-looming-macro-economic-conditions-8c089a36c20b?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c089a36c20b</guid>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[marketing-mix-modeling]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[advertising]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Wed, 25 May 2022 08:36:53 GMT</pubDate>
            <atom:updated>2022-05-25T08:38:09.654Z</atom:updated>
            <content:encoded><![CDATA[<h3>Will the adoption of MMM and MTA increase or decrease given the looming macro economic conditions ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*Mb_R40ZEMfAruLcX2WYvWA.jpeg" /><figcaption>Image source : Pixabay</figcaption></figure><p>I have been having interesting conversations with my clients and prospective clients of late.</p><p>One question that is on everybody’s mind is “Will the adoption of MMM and MTA increase or decrease given the looming macro economic conditions ?”</p><p>Here is my take :</p><p><strong>1) Being prudent with marketing spends.</strong></p><p>Organizations want to become more prudent with their marketing spends. They want to maintain same level of marketing spends and yet retain same (or higher) levels of sales (or other KPIs).</p><p>MMM is tailor made for scenarios like this. Budget optimization post MMM helps answer exactly this.</p><p><strong>2) MMM’s time in the sun just arrived sooner</strong></p><p><a href="https://ridhima-kumar0203.medium.com/marketing-mix-models-mmm-the-go-to-solution-in-a-cookie-less-world-2b8c98316cb1">With Google about to pull the plug on third party cookies in 2023</a> and data privacy regulations in place, most brands have been looking at other methods to measure their marketing effectiveness.</p><p>Many marketers had opined that the adoption of MMM will hence skyrocket. I believe the impending economic conditions will make the adoption of MMM even quicker.</p><p><strong>3) MMM will be the barometer every organization needs.</strong></p><p>During these tumultuous times, every organization would like to constantly measure their Marketing ROI. They would want to know how best to deploy their marketing budget into various marketing media. MMM is the best MROI or ROAS barometer.</p><p>As they say, every cloud has a silver lining. The upcoming financial tough times will perhaps make organizations adopt more prudent marketing strategies aided by good domain knowledge and data driven methods.</p><p>I believe we all will learn to make more with less.</p><p>For innovative marketing analytics solutions, you can reach out to us at:</p><p>Website: <a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c089a36c20b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Marketing Mix Models (MMM) — The go-to solution in a cookie-less world]]></title>
            <link>https://ridhima-kumar0203.medium.com/marketing-mix-models-mmm-the-go-to-solution-in-a-cookie-less-world-2b8c98316cb1?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b8c98316cb1</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[marketing-mix-modeling]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Mon, 20 Dec 2021 04:57:37 GMT</pubDate>
            <atom:updated>2021-12-20T04:57:37.248Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Marketing Mix Models (MMM) — The go-to solution in a cookie-less world</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*5Us0kc-EeApSqr-cs1_Duw.png" /><figcaption>Image: Author</figcaption></figure><p>With browsers pulling the plug on third party cookies in 2023 and data privacy regulations in place, most brands have been looking at other methods to measure their marketing effectiveness.</p><p>One such method which can aid marketers in creating effective strategies is Marketing Mix Modeling (MMM).</p><p>MMM is being used in various industries for quite some time now, but many marketers have started to realize its importance due to third party cookies getting deprecated.</p><p>There are many advantages which MMM offer. Most data required for MMM are easily available and MMM doesn’t need customer personally identifiable information (PII).</p><p>However, there are several myths associated with MMM:</p><p>1. MMMs take lot of time to build</p><p>2. MMMs are expensive</p><p>3. MMMs are data intensive</p><p>4. MMMs don’t factor in digital data</p><p>5. MMMs can only be used by CPG industry</p><p>Well, neither of the above myth is correct.</p><p>Here is a take on how MMM has stood the test of time and will be useful for a long time to come.</p><h4><strong>The revamped MMM is more agile</strong></h4><p>With digital disruption taking place, MMM has seen a big revamp. Gone are the days when Marketing Mix Models used to take months to build. MMMs used these days are more agile and can be built faster and for shorter time periods. The quick and ready to use MMMs can provide actionable insights at a quicker cadence to marketers who are looking to get more real time insights.</p><h4><strong>The new MMM can use more granular data</strong></h4><p>Most digital campaigns have a short-term impact on Brand Awareness. Marketers need to feel the pulse of the customers/markets faster, and course correct their campaigns to get higher returns. To cater to such demands, MMMs can be easily adjusted to factor in more granular data (weekly/daily)</p><h4><strong>MMM goes hand-in-hand with the new digitally savvy world</strong></h4><p>Due to Covid-19, e-commerce sector has seen an unprecedented growth in the last year. With the rise in e-commerce revenue, many brands are interested in knowing which campaigns move the needle of online sales. Many brands have started to realize how MMM can help them understand that.</p><ul><li>Brands have started using MMM to understand which social media platforms work better and which campaigns are generating higher ROAS.</li><li>MMM is not just backward looking anymore, the new agile MMM can be used for understanding which campaigns could work better.</li></ul><blockquote>MMM is not just backward looking anymore, the new agile MMM can be used for understanding which campaigns could work better.</blockquote><h4><strong>MMM adoption going up</strong></h4><p>The purpose of using MMM is to quantify the impact of various marketing investments on KPIs such as Sales, Market Share, Brand Awareness, Leads, Orders etc.</p><p>Any marketers goal is to get the bang for their buck. This goal is same across all brands irrespective of whichever industry or category they are into.</p><p>Gone are the days when MMM used to be applied only in CPG. MMM is now readily adopted in various industries such as like e-commerce, pharma, manufacturing, banking, travel/hospitality etc.</p><blockquote>Gone are the days when MMM used to be applied only in CPG. MMM is now readily adopted in various industries such as like e-commerce, pharma, manufacturing, banking, travel/hospitality etc.</blockquote><h4><strong>The Takeaway</strong></h4><p>With the data privacy concerns increasing and the world becoming less, and less cookie driven, MMM will be a crucial tool in the armor of marketing teams.</p><p>For innovative marketing analytics solutions, you can reach out to us at:</p><p>Website: <a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b8c98316cb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Lessons From Building 20 Markov Chain Attribution Models on Real Datasets]]></title>
            <link>https://ridhima-kumar0203.medium.com/7-lessons-from-building-20-markov-chain-attribution-models-on-real-datasets-f30ee5562be8?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f30ee5562be8</guid>
            <category><![CDATA[marketing-attribution]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[marketing]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Mon, 30 Aug 2021 08:14:17 GMT</pubDate>
            <atom:updated>2021-08-30T08:14:17.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*-aRsWFgq81FXmaV6sy05ug.png" /><figcaption>Image : Author</figcaption></figure><p>We have built 20 Markov Attribution models for various companies across geographies in the last 2 yrs.</p><p>Here are the 7 lessons we learnt along the way.</p><p><strong>Reality is different from toy examples:</strong></p><p>Things don’t work as easily as illustrated on toy examples. Markov Attributions implementation on a Real data set is a different beast altogether.</p><p><strong>It is all about the Paths:</strong></p><p>Roughly, 60% of the Markov attribution projects is about Data pre-processing and data transformation (forming the paths).</p><p><strong>Pay attention to the timestamp:</strong></p><p>While aggregating the data, one needs to pay attention to the order of timestamp (both in terms of format and chronology). The chronology of path is extremely important.<br>Any mix up will result in wrong attributions.</p><p><strong>It is good to break the problem:</strong></p><p>Customers are more interested in which paths lead to conversion rather than which has not. Hence it makes sense to break your data set into two <br>Paths leading to conversion<br>Paths leading to No conversion</p><p><strong>Apply the algorithm selectively:</strong></p><p>Building up on the last point, apply the algorithm only on the ‘path s leading to conversion’. Applying the algorithm to the whole data set (sometimes having millions of records) can lead to intractable solution.</p><p><strong>Don’t forget the removal effects:</strong></p><p>The removal effect tells you how much is the contribution of a channel by removing that channel from the path and seeing how many conversions are happening without that channel. Applying Removal effects is crucial to get the right attributions.</p><p><strong>Interpret Markov results through lens of Domain Experience:</strong></p><p>The Markov results only show which paths lead to higher conversions. It does not quantify the value of each conversion per say.</p><p>For example path A may have resulted in maximum number of conversion relative to path B but path B though having less number of conversion could have resulted in the conversions with higher revenue.</p><p>For innovative marketing science solutions, you can reach out to us at:</p><p>Website: <a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f30ee5562be8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Lost Art of Decile Analysis]]></title>
            <link>https://medium.com/analytics-vidhya/the-lost-art-of-decile-analysis-33719cd08425?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/33719cd08425</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Sat, 19 Jun 2021 08:36:00 GMT</pubDate>
            <atom:updated>2021-07-05T06:25:46.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7RoapONYLbivw3nclZYIQ.jpeg" /><figcaption>Source : Unsplash</figcaption></figure><blockquote><em>“Logistic Regression is not Regression but a Classification Algorithm”.</em></blockquote><p>You might have seen this in latest popular machine learning books, blogs or you might have heard *Data Science Gurus* utter the same in their highly subscribed YouTube channels.</p><p>Machine learning has usurped and renamed many statistical techniques. Often to the extent that they now disbelieve and reject its statistical origins. Case in point is “Logistic regression is not Regression”</p><p>However, nothing can be further from the truth than this assertion. We live in a meme culture, memes even become cryptocurrency.</p><p>So why not use a meme to drive home the point that Logistic Regression is indeed Regression.</p><blockquote><em>Logistic Regression is indeed Regression.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*CLKRu0x570IVSJFCJMfMcg.jpeg" /><figcaption>Source: Author</figcaption></figure><p>This meme would have made things clearer for most of you. However, let me unpack it for more clarity.</p><blockquote>Logistic Regression models a continuous outcome (the probabilities). The probabilities range between 0 and 1.</blockquote><p>Binary Logistic Regression is used as a Classification algorithm when we want the response variable to be dichotomous (Churn/Not Churned, Pass/Fail, Spam/No spam etc.)</p><p>Usually, we make Logistic Regression into a classification algorithm by setting an appropriate probability cut-off or threshold (0.4, 0.5, 0.6 etc.).</p><p><strong>The problem of classifying using a threshold value</strong></p><p>Fixing the probability threshold is purely a business call and not a statistical one. The threshold could vary from one domain/industry to another.</p><p>Frank Harrell in his blog¹ aptly makes the point “classification is a forced choice”.</p><blockquote>Classification is a forced choice.</blockquote><p>Now consider this example, you choose a threshold value of 0.5. Now the ML algorithm outputs the probability of default or no default (1- default, 0 — no default) for 4 customers as 0.51, 0.49, 0.23 and 0.92. Based on the threshold, 2 are classified as ‘default’ and 2 are classified as ‘no default’. However, ask yourself this, isn’t it too close to call for the customers with probability 0.51 and 0.49? 0.51 is surely closer to 0.49 (which is classified as no default) than it is to 0.92 (which is classified as default).</p><p>Some popular machine learning packages and low code tools do not depict the predicted probabilities to the user explicitly. The user is hence oblivious to what predicted probabilities are gotten. He /she simply gets the decision — default or no default (1 or 0). In the case of 0.49 and 0.51, the user happily made the decision that the person will not default and will default respectively. But a peek inside the predicted probabilities reveals that it was too close to call!</p><p>The other problem with thresholds is that, when we use an improper scoring rule like classification accuracy, it can be easily gamed. For e.g., if out of 100 people, 95 of them default on loan, and 5 don’t. If the classifier classifies everyone to default on loan, then it would have an accuracy of 95% !!</p><p><strong>So, is there a better way to use Logistic Regression?</strong></p><p>The answer is Yes.</p><p>Industries such as Finance and Marketing use Logistic Regression in a more appropriate way for Credit risk modelling and marketing campaign targeting respectively.</p><p><strong>A real use case</strong></p><p>Let us say, you are a CMO in charge for sales and marketing of a product in your organization. You plan to launch a marketing campaign to increase sales of that product. You have been given a fixed budget for this. Now you would like to get the best ROI possible i.e., spend the exact fixed budget or even lesser and get the maximum sales possible. Here is what you have.</p><p>You have the data for 10,000 customers who had either purchased or not purchased a similar product in the past.</p><p>You would like to understand which customers should be targeted to increase the likelihood of purchase this time.</p><p>You would obviously like to target those people who are more likely to buy the product since you have a fixed budget for the campaign. How to go about it?</p><h3>Decile Analysis and Gain Chart come to rescue here.</h3><p><strong>What is a Decile Analysis?</strong></p><p>Decile analysis was once a popularly used technique, however the convention of teaching and bucketing machine learning problems into either ‘classification’ or ‘Regression’ types, lead people to forget Decile analysis type analyses. I am pretty sure, most freshly minted data scientists would not have even heard of Decile analysis. So, coming back to what is Decile Analysis.</p><p>Decile Analysis is used to categorize dataset from highest to lowest values or vice versa. (Based on predicted probabilities)</p><p>As obvious from the name, the analysis involves dividing the dataset into ten equal groups. Each group should have the same no. of observations/customers.</p><p>It ranks customers in the order from most likely to respond to least likely to respond.</p><p>How is Decile Analysis done?</p><p><strong>Step 1:</strong> Build a Logistic Regression model. In this case the dependent variable was ‘probability of buying the product’. With 1 denoting purchased, 0 denoting not purchased. Also, the relevant independent variables were selected.</p><p><strong>Step 2:</strong> Get the predicted probabilities from Logistic Regression algorithm. Arrange the probabilities in descending order.</p><p><strong>Step 3: </strong>Divide the whole dataset into 10 groups, each group should contain equal no. of observations. So, if there 10,000 records, each group would have 1000 records/customers.</p><p><strong>Step 4:</strong> Compute % of responders for each decile</p><p><strong>Step 5: </strong>Compute response rate for each decile</p><p><strong>Step 6:</strong> Compute lift for each decile</p><p>The top decile would have customers who are most likely to respond followed by the decile 2 which would have customers who are next most likely to respond and so on.</p><p>One major advantage of the decile analysis is that the probabilities and probability range are their own error measures. That is, if the top decile has the probability range 0.75–0.81, then then the probability of this person not buying the product i.e., the error would be (1- [0.75–0.81], here ‘[]’ denotes the interval of values between 0.75–0.81 including 0.75 and 0.81)</p><p>What does a Decile Analysis output look like?</p><p>The below table depicts a typical decile analysis output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*kIYyM2bOGe9edcPhufbL2A.png" /><figcaption>Table 1 : Source Author</figcaption></figure><p>Let’s unpack the output table.</p><p>As stated earlier, each decile has equal number of customers (1000 in each decile).</p><p><strong>% of responders for each decile</strong> = No. of responders in that decile/ No. of total responders for all 10 deciles</p><p>Refer to Table 1:</p><p>Here, % of responders for Decile 1 = 224/984 = 22.8%</p><p>984 is the total no. of responders in all 10 deciles</p><p>Similarly, % of responders for Decile 2 = 16.5% (162/984)</p><p>And cumulative % of responders for top 2 deciles = 39.2%</p><h3>Gains and Gain Chart:</h3><p>From table 1, Decile 1 contains top 10% of the customers who are most likely to buy. Decile 1 has the highest no. of responders (224 responders).</p><p>So out of the total responders in all deciles, 22.8% of the responders are in Decile 1. So, for 10% of the customer base, there are 22.8% responses in Decile 1.</p><p>Similarly for 20% of the customer base in decile 1 and decile 2, there are 39.2% responses.</p><p>Gain Chart below explains this better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*7EWDf96vQHrqmhq3Cwi0NA.png" /><figcaption>Source: Author</figcaption></figure><p><strong>Takeaway from Gain Chart: </strong>Gain Chart can be used to assess what % of customers respond in each decile. So, rather than targeting customers from lower deciles, customers can be picked up from the top deciles only.</p><p>The dashed line is the Baseline. Baseline tells how much % of customers would respond if we target customers randomly without a model.</p><h3>Response Rate</h3><p>Response Rate tells what is the percentage of customers who responded in each decile. The response % is highest in Decile 1 followed by Decile 2 and so on.</p><p><strong>Response Rate for each decile</strong> = No. of respondent in that decile/ No. of customers in that decile</p><p>Refer to Table 1:</p><p>Here, Response Rate for Decile 1 = 224/ 1000 = 22.4%</p><p><strong>Takeaway from Response Rates comparison:</strong> Response Rate of each decile is depicted in the chart below. The average response rate of all deciles is 9.8%. So, customers from Decile 1 to Decile 4 lie above the average response rate and should be targeted for the campaign.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*CKLGStA6hF5QfOpyEeL2IQ.png" /><figcaption>Source : Author</figcaption></figure><h3>Lift and Lift Curve</h3><p><strong>Lift</strong> = cumulative % of responders / customers % at each decile</p><p>Refer to Table 1:</p><p>Lift for Decile 1 = 22.8%/10% = 2.28</p><p>Lift for Decile 2 = 39.2%/20% = 1.96</p><p><strong>How to interpret</strong>: If we target top two deciles, then we would target 20% of the customers. In the same deciles, the cumulative % of responders are 39.2%. Hence, there is a lift of 1.96.</p><p>A lift of 1 means there is no gain compared with the no. of customers targeted at random. Lift greater than 1 means, model approach is better than selecting the customers at random.</p><p><strong>Takeaway from Lift Chart:</strong> Can be used to identify the deciles which have a higher Lift.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*UBRRQE3tirCTL7No2oQflQ.png" /><figcaption>Source : Author</figcaption></figure><h3>How to use Decile Analysis in business decision making:</h3><p>Now that we have done building Decile Analysis, the next pertinent question is how we use it to make effective business decisions:</p><p><strong>Let us revisit our Decile Analysis Table</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*1fe6_6rG4qHxwGWlp7Znrw.png" /><figcaption>Source : Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*deQsxsJO03ZESebwKBtNNg.png" /><figcaption>Source : Author</figcaption></figure><p>Going by the above results, we make a decision that we will target customers in the Top 4 deciles as they have higher probability of buying the product.</p><p>From the business point of view, the ROI of targeting the Top 4 deciles is more. As we move down the decile, the ROI rapidly decreases and is not worthwhile pursuing these customers.</p><p>So, that wraps up our decile analysis article. Your comments are welcome.</p><p>“This article was contributed by <a href="https://www.arymalabs.com/">Aryma Labs</a>. Co-authored by <a href="https://www.linkedin.com/in/venkat-raman-analytics/">Venkat Raman</a> and <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a>.</p><p>Aryma Labs is a Data Science Firm specializing in Marketing Mix Modeling, Marketing/Digital analytics, Machine learning and NLP.</p><p>We cater to clients across FMCG, E-Commerce, Banking, Manufacturing, Media and Advertising industries.”</p><p>References:</p><ol><li><a href="https://www.fharrell.com/post/classification/">https://www.fharrell.com/post/classification/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33719cd08425" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/the-lost-art-of-decile-analysis-33719cd08425">The Lost Art of Decile Analysis</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Lost Art of Decile Analysis]]></title>
            <link>https://medium.com/aryma-labs/the-lost-art-of-decile-analysis-a93f3636f1ad?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a93f3636f1ad</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[digital-marketing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Thu, 17 Jun 2021 09:52:54 GMT</pubDate>
            <atom:updated>2021-06-17T09:52:54.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkswRQ6uyDsUl1-16v_yBw.jpeg" /><figcaption>Source: Unsplash</figcaption></figure><blockquote><strong>“Logistic Regression is not Regression but a Classification Algorithm”.</strong></blockquote><p>You might have seen this in latest popular machine learning books, blogs or you might have heard *Data Science Gurus* utter the same in their highly subscribed YouTube channels.</p><p>Machine learning has usurped and renamed many statistical techniques. Often to the extent that they now disbelieve and reject its statistical origins. Case in point is “Logistic regression is not Regression”</p><p>However, nothing can be further from the truth than this assertion. We live in a meme culture, memes even become cryptocurrency.</p><p>So why not use a meme to drive home the point that Logistic Regression is indeed Regression.</p><blockquote>Logistic Regression is indeed Regression.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*WLDKP7hRVFFjRW5V0e4tfQ.jpeg" /><figcaption>Source: Author</figcaption></figure><p>This meme would have made things clearer for most of you. However, let me unpack it for more clarity.</p><blockquote>Logistic Regression models a continuous outcome (the probabilities). The probabilities range between 0 and 1.</blockquote><p>Binary Logistic Regression is used as a Classification algorithm when we want the response variable to be dichotomous (Churn/Not Churned, Pass/Fail, Spam/No spam etc.)</p><p>Usually, we make Logistic Regression into a classification algorithm by setting an appropriate probability cut-off or threshold (0.4, 0.5, 0.6 etc.).</p><p><strong>The problem of classifying using a threshold value</strong></p><p>Fixing the probability threshold is purely a business call and not a statistical one. The threshold could vary from one domain/industry to another.</p><p>Frank Harrell in his blog¹ aptly makes the point “classification is a forced choice”.</p><blockquote>Classification is a forced choice.</blockquote><p>Now consider this example, you choose a threshold value of 0.5. Now the ML algorithm outputs the probability of default or no default (1- default, 0 — no default) for 4 customers as 0.51, 0.49, 0.23 and 0.92. Based on the threshold, 2 are classified as ‘default’ and 2 are classified as ‘no default’. However, ask yourself this, isn’t it too close to call for the customers with probability 0.51 and 0.49? 0.51 is surely closer to 0.49 (which is classified as no default) than it is to 0.92 (which is classified as default).</p><p>Some popular machine learning packages and low code tools do not depict the predicted probabilities to the user explicitly. The user is hence oblivious to what predicted probabilities are gotten. He /she simply gets the decision — default or no default (1 or 0). In the case of 0.49 and 0.51, the user happily made the decision that the person will not default and will default respectively. But a peek inside the predicted probabilities reveals that it was too close to call!</p><p>The other problem with thresholds is that, when we use an improper scoring rule like classification accuracy, it can be easily gamed. For e.g., if out of 100 people, 95 of them default on loan, and 5 don’t. If the classifier classifies everyone to default on loan, then it would have an accuracy of 95% !!</p><p><strong>So, is there a better way to use Logistic Regression?</strong></p><p>The answer is Yes.</p><p>Industries such as Finance and Marketing use Logistic Regression in a more appropriate way for Credit risk modelling and marketing campaign targeting respectively.</p><p><strong>A real use case</strong></p><p>Let us say, you are a CMO in charge for sales and marketing of a product in your organization. You plan to launch a marketing campaign to increase sales of that product. You have been given a fixed budget for this. Now you would like to get the best ROI possible i.e., spend the exact fixed budget or even lesser and get the maximum sales possible. Here is what you have.</p><p>You have the data for 10,000 customers who had either purchased or not purchased a similar product in the past.</p><p>You would like to understand which customers should be targeted to increase the likelihood of purchase this time.</p><p>You would obviously like to target those people who are more likely to buy the product since you have a fixed budget for the campaign. How to go about it?</p><h4><strong>Decile Analysis and Gain Chart come to rescue here.</strong></h4><p><strong>What is a Decile Analysis?</strong></p><p>Decile analysis was once a popularly used technique, however the convention of teaching and bucketing machine learning problems into either ‘classification’ or ‘Regression’ types, lead people to forget Decile analysis type analyses. I am pretty sure, most freshly minted data scientists would not have even heard of Decile analysis. So, coming back to what is Decile Analysis.</p><p>Decile Analysis is used to categorize dataset from highest to lowest values or vice versa. (Based on predicted probabilities)</p><p>As obvious from the name, the analysis involves dividing the dataset into ten equal groups. Each group should have the same no. of observations/customers.</p><p>It ranks customers in the order from most likely to respond to least likely to respond.</p><p>How is Decile Analysis done?</p><p><strong>Step 1:</strong> Build a Logistic Regression model. In this case the dependent variable was ‘probability of buying the product’. With 1 denoting purchased, 0 denoting not purchased. Also, the relevant independent variables were selected.</p><p><strong>Step 2:</strong> Get the predicted probabilities from Logistic Regression algorithm. Arrange the probabilities in descending order.</p><p><strong>Step 3: </strong>Divide the whole dataset into 10 groups, each group should contain equal no. of observations. So, if there 10,000 records, each group would have 1000 records/customers.</p><p><strong>Step 4:</strong> Compute % of responders for each decile</p><p><strong>Step 5: </strong>Compute response rate for each decile</p><p><strong>Step 6:</strong> Compute lift for each decile</p><p>The top decile would have customers who are most likely to respond followed by the decile 2 which would have customers who are next most likely to respond and so on.</p><p>One major advantage of the decile analysis is that the probabilities and probability range are their own error measures. That is, if the top decile has the probability range 0.75–0.81, then then the probability of this person not buying the product i.e., the error would be (1- [0.75–0.81], here ‘[]’ denotes the interval of values between 0.75–0.81 including 0.75 and 0.81)</p><p>What does a Decile Analysis output look like?</p><p>The below table depicts a typical decile analysis output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*TrWMeXMrS-uI_iXbptEXUQ.png" /><figcaption>Table 1 — Source: Author</figcaption></figure><p>Let’s unpack the output table.</p><p>As stated earlier, each decile has equal number of customers (1000 in each decile).</p><p><strong>% of responders for each decile</strong> = No. of responders in that decile/ No. of total responders for all 10 deciles</p><p>Refer to Table 1:</p><p>Here, % of responders for Decile 1 = 224/984 = 22.8%</p><p>984 is the total no. of responders in all 10 deciles</p><p>Similarly, % of responders for Decile 2 = 16.5% (162/984)</p><p>And cumulative % of responders for top 2 deciles = 39.2%</p><h4><strong>Gains and Gain Chart:</strong></h4><p>From table 1, Decile 1 contains top 10% of the customers who are most likely to buy. Decile 1 has the highest no. of responders (224 responders).</p><p>So out of the total responders in all deciles, 22.8% of the responders are in Decile 1. So, for 10% of the customer base, there are 22.8% responses in Decile 1.</p><p>Similarly for 20% of the customer base in decile 1 and decile 2, there are 39.2% responses.</p><p>Gain Chart below explains this better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*Gx7vqvr_OzO_2pHapxgL5g.png" /><figcaption>Source: Author</figcaption></figure><p><strong>Takeaway from Gain Chart: </strong>Gain Chart can be used to assess what % of customers respond in each decile. So, rather than targeting customers from lower deciles, customers can be picked up from the top deciles only.</p><p>The dashed line is the Baseline. Baseline tells how much % of customers would respond if we target customers randomly without a model.</p><h4><strong>Response Rate</strong></h4><p>Response Rate tells what is the percentage of customers who responded in each decile. The response % is highest in Decile 1 followed by Decile 2 and so on.</p><p><strong>Response Rate for each decile</strong> = No. of respondent in that decile/ No. of customers in that decile</p><p>Refer to Table 1:</p><p>Here, Response Rate for Decile 1 = 224/ 1000 = 22.4%</p><p><strong>Takeaway from Response Rates comparison:</strong> Response Rate of each decile is depicted in the chart below. The average response rate of all deciles is 9.8%. So, customers from Decile 1 to Decile 4 lie above the average response rate and should be targeted for the campaign.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*2IqJCTH93QSpVMCNaYFYlQ.png" /><figcaption>Source: Author</figcaption></figure><h4><strong>Lift and Lift Curve</strong></h4><p><strong>Lift</strong> = cumulative % of responders / customers % at each decile</p><p>Refer to Table 1:</p><p>Lift for Decile 1 = 22.8%/10% = 2.28</p><p>Lift for Decile 2 = 39.2%/20% = 1.96</p><p><strong>How to interpret</strong>: If we target top two deciles, then we would target 20% of the customers. In the same deciles, the cumulative % of responders are 39.2%. Hence, there is a lift of 1.96.</p><p>A lift of 1 means there is no gain compared with the no. of customers targeted at random. Lift greater than 1 means, model approach is better than selecting the customers at random.</p><p><strong>Takeaway from Lift Chart:</strong> Can be used to identify the deciles which have a higher Lift.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*-ymCkaFCx_TB2F-DJS7TGw.png" /><figcaption>Source: Author</figcaption></figure><h4><strong>How to use Decile Analysis in business decision making:</strong></h4><p>Now that we have done building Decile Analysis, the next pertinent question is how we use it to make effective business decisions:</p><p><strong>Let us revisit our Decile Analysis Table</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*yvF_rf-zcj-asplnSa0a2w.png" /><figcaption>Source: Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*-0iyArrDbzKwr4q1nO0vLg.png" /><figcaption>Source: Author</figcaption></figure><p>Going by the above results, we make a decision that we will target customers in the Top 4 deciles as they have higher probability of buying the product.</p><p>From the business point of view, the ROI of targeting the Top 4 deciles is more. As we move down the decile, the ROI rapidly decreases and is not worthwhile pursuing these customers.</p><p>So, that wraps up our decile analysis article. Your comments are welcome.</p><p>For innovative Marketing solutions through Data Science, get in touch with <strong>Aryma Labs — </strong><em>Your one stop solution for Marketing Science</em></p><p><a href="https://www.arymalabs.com/">Data Science Consulting</a></p><p>References:</p><ol><li><a href="https://www.fharrell.com/post/classification/">https://www.fharrell.com/post/classification/</a></li></ol><p><strong>© Copyright 2021 </strong><a href="http://www.arymalabs.com/"><strong>www.arymalabs.com</strong></a><strong> All Rights Reserved.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a93f3636f1ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aryma-labs/the-lost-art-of-decile-analysis-a93f3636f1ad">The Lost Art of Decile Analysis</a> was originally published in <a href="https://medium.com/aryma-labs">Aryma Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Devising better Marketing Campaign Strategy through Dynamic Time Warping]]></title>
            <link>https://ridhima-kumar0203.medium.com/devising-better-marketing-campaign-strategy-through-dynamic-time-warping-9639ddf0557c?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9639ddf0557c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[martech]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[marketing-strategies]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Tue, 04 May 2021 04:15:39 GMT</pubDate>
            <atom:updated>2021-05-04T04:22:43.608Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*VkNTIak8i-MTlxbjAdpKxQ.jpeg" /><figcaption>Image Source: <a href="https://pixabay.com/photos/wormhole-time-travel-portal-vortex-2514312/">Pixabay</a></figcaption></figure><p><strong>If the words ‘Dynamic Time Warping’ evokes a sense of time travel science fiction, you would not be at fault.</strong></p><p>So let us first unpack this science fiction terminology.</p><p><strong>Dynamic Time Warping</strong></p><p>Dynamic Time Warping (DTW) is a time series analysis technique used for measuring similarity between two temporal sequence. These sequences or time series could be of different length as well.</p><p>It calculates the optimal match between two series using a set of rules. Suppose there are two series — A and B. The DTW algorithm minimizes the distance between them by creating a warping path W (now you know where the word ‘warping’ comes from in DTW).</p><p><strong>How is it different from other distance metrics like Euclidean Distance?</strong></p><p>Euclidean distance is useful when both the time series are in sync and will compare the value of series 1 at time t with the value of series 2 at time t. Basically, it does one-to-one match and does not take into account time shifts.</p><p>DTW on the other hand applies one-to-many or many-to-one matches in such a way that the overall distance between the two series is minimized. It allows two similar shaped series of different lengths to match.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*GtLLPj_xTIB_EfhG2ZIHAQ.png" /><figcaption>Image Source: <a href="http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf">http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf</a></figcaption></figure><p>DTW has been applied in diverse fields such as speech pattern recognition and signal processing. However, the application of DTW in the field of Marketing has been rare.</p><p><strong>In this post we will showcase a novel application of DTW in the field of Marketing.</strong></p><p><strong>Business Problem:</strong></p><p>• The client ran marketing campaign in one market for a period of one year (August 2019 — July 2020) and noticed that the campaign was highly successful in generating incremental leads. This market was termed as ‘Ideal Market’.</p><p>• The client planned on implementing the campaign in other new markets (identified as candidate markets) and wanted to identify which of these candidate markets were like the ‘ideal market’.</p><p>• The issue was, they did not want to run the campaigns in all the ‘candidate markets’ for a period of 1 year owing to cost concerns.</p><p>• The ask was to identify early signs whether a ‘candidate market’ is like the ‘ideal market’ in terms of campaign response instead of having to wait till the year end.</p><p><strong>Approach:</strong></p><p>Dynamic Time Warping algorithm was used to understand which candidate markets were similar in behavior to the ‘Ideal Market’.</p><ul><li>The client had identified one market as an ideal market where the campaign was successful (Campaign was run from Aug’19 to Jul’20 and leads were recorded for this period).</li><li>7 candidate markets were identified by the client to run the similar campaign.</li><li>For these candidate markets, the leads and campaign data were available for a period Aug’20 — Dec’20 (5 months).</li><li>The leads from these candidate markets (Aug’20 — Dec’20) were compared with the leads from the ideal market (Aug’19 — Dec’19) using DTW algorithm.</li><li>The markets with lowest distance w.r.t ideal market were selected to continue the campaign for further period.</li></ul><p><strong>Our Recommendation:</strong></p><ul><li>It was observed that out of the ‘7 Candidate Markets’, there were 4 markets which were most similar to the ‘Ideal Market’ (highlighted in the image below).</li><li>We suggested the client to continue the campaign in these 4 candidate markets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*yY8RCrAufbvLMJddgXLL6A.png" /><figcaption>Image Source: <a href="https://www.arymalabs.com/">Author</a></figcaption></figure><p><strong>Result Evaluation &amp; Impact</strong></p><p>The client was recommended to continue campaigns in these 4 most similar markets instead of running campaign in all ‘Candidate Markets’.</p><p>In the post implementation evaluation conducted in April 2021, it was found that out of the 4 markets suggested by us:</p><ul><li>Candidate market A, E and F got 5%, 9% and 6% incremental leads, respectively.</li><li>Candidate market D got 2% incremental leads.</li></ul><p><strong>Overall, this solution helped the client in:</strong></p><ul><li><strong>Correctly identifying similar markets out of a cohort of markets thereby cutting costs.</strong></li><li><strong>The identified markets netted higher number of leads.</strong></li></ul><p><strong>References</strong></p><ol><li><a href="http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf">http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf</a></li><li><a href="https://en.wikipedia.org/wiki/Dynamic_time_warping">https://en.wikipedia.org/wiki/Dynamic_time_warping</a></li></ol><p>For innovative marketing science solutions, you can reach out to us at:</p><p>Website: <a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9639ddf0557c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Devising better Marketing Campaign Strategy through Dynamic Time Warping]]></title>
            <link>https://medium.com/aryma-labs/devising-better-marketing-campaign-strategy-through-dynamic-time-warping-4d9a0932777?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d9a0932777</guid>
            <category><![CDATA[martech]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[marketing-campaign]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Mon, 03 May 2021 07:55:21 GMT</pubDate>
            <atom:updated>2021-05-03T07:55:21.492Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3XfLd0bN-c6_RqsAQwKubg.jpeg" /><figcaption>Image Source: <a href="https://pixabay.com/photos/wormhole-time-travel-portal-vortex-2514312/">Pixabay</a></figcaption></figure><p><strong>If the words ‘Dynamic Time Warping’ evokes a sense of time travel science fiction, you would not be at fault.</strong></p><p><strong>So let us first unpack this science fiction terminology.</strong></p><p><strong>Dynamic Time Warping</strong></p><p>Dynamic Time Warping (DTW) is a time series analysis technique used for measuring similarity between two temporal sequence. These sequences or time series could be of different length as well.</p><p>It calculates the optimal match between two series using a set of rules. Suppose there are two series — A and B. The DTW algorithm minimizes the distance between them by creating a warping path W (now you know where the word ‘warping’ come from in DTW).</p><p><strong>How is it different from other distance metrics like Euclidean Distance?</strong></p><p>Euclidean distance is useful when both the time series are in sync and will compare the value of series 1 at time t with the value of series 2 at time t. Basically, it does one-to-one match and does not take into account time shifts.</p><p>DTW on the other hand applies one-to-many or many-to-one matches in such a way that the overall distance between the two series is minimized. It allows two similar shaped series of different lengths to match.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*mlPtiFyJBzqLmb68DwRxgA.png" /><figcaption>Image Source: <a href="http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf">http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf</a></figcaption></figure><p>DTW has been applied in diverse fields such as speech pattern recognition and signal processing. However, the application of DTW in the field of Marketing has been rare.</p><p><strong>In this post we will showcase a novel application of DTW in the field of Marketing.</strong></p><p><strong>Business Problem:</strong></p><p>• The client ran marketing campaign in one market for a period of one year (August 2019 — July 2020) and noticed that the campaign was highly successful in generating incremental leads. This market was termed as ‘Ideal Market’.</p><p>• The client planned on implementing the campaign in other new markets (identified as candidate markets) and wanted to identify which of these candidate markets were like the ‘ideal market’.</p><p>• The issue was, they did not want to run the campaigns in all the ‘candidate markets’ for a period of 1 year owing to cost concerns.</p><p>• The ask was to identify early signs whether a ‘candidate market’ is like the ‘ideal market’ in terms of campaign response instead of having to wait till the year end.</p><p><strong>Approach:</strong></p><p>Dynamic Time Warping algorithm was used to understand which candidate markets were similar in behaviour to the ‘Ideal Market’.</p><ul><li>The client had identified one market as an ideal market where the campaign was successful (Campaign was run from Aug’19 to Jul’20 and leads were recorded for this period).</li><li>7 candidate markets were identified by the client to run the similar campaign.</li><li>For these candidate markets, the leads and campaign data were available for a period Aug’20 — Dec’20 (5 months).</li><li>The leads from these candidate markets (Aug’20 — Dec’20) were compared with the leads from the ideal market (Aug’19 — Dec’19) using DTW algorithm.</li><li>The markets with lowest distance w.r.t ideal market were selected to continue the campaign for further period.</li></ul><p><strong>Our Recommendation:</strong></p><ul><li>It was observed that out of the ‘7 Candidate Markets’, there were 4 markets which were most similar to the ‘Ideal Market’ (highlighted in the image below).</li><li>We suggested the client to continue the campaign in these 4 candidate markets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*2aeeCBQTtpnePI-X1DjfSw.png" /><figcaption>Image Source: <a href="https://www.arymalabs.com/">Author</a></figcaption></figure><p><strong>Result Evaluation &amp; Impact</strong></p><p>The client was recommended to continue campaigns in these 4 most similar markets instead of running campaign in all ‘Candidate Markets’.</p><p>In the post implementation evaluation conducted in April 2021, it was found that out of the 4 markets suggested by us:</p><ul><li>Candidate market A, E and F got 5%, 9% and 6% incremental leads, respectively.</li><li>Candidate market D got 2% incremental leads.</li></ul><p><strong>Overall, this solution helped the client in:</strong></p><ul><li><strong>Correctly identifying similar markets out of a cohort of markets thereby cutting costs.</strong></li><li><strong>The identified markets netted higher number of leads.</strong></li></ul><p>For innovative Marketing solutions through Data Science, get in touch with <strong>Aryma Labs — </strong><em>Your one stop solution for Marketing Science</em></p><p><a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></p><p><strong>References</strong></p><ol><li><a href="http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf">http://www.mathcs.emory.edu/~lxiong/cs730_s13/share/slides/searching_sigkdd2012_DTW.pdf</a></li><li><a href="https://en.wikipedia.org/wiki/Dynamic_time_warping">https://en.wikipedia.org/wiki/Dynamic_time_warping</a></li></ol><p><strong>© Copyright 2021 </strong><a href="http://www.arymalabs.com/"><strong>www.arymalabs.com</strong></a><strong> All Rights Reserved.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d9a0932777" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aryma-labs/devising-better-marketing-campaign-strategy-through-dynamic-time-warping-4d9a0932777">Devising better Marketing Campaign Strategy through Dynamic Time Warping</a> was originally published in <a href="https://medium.com/aryma-labs">Aryma Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MAD Over MAPE?]]></title>
            <link>https://medium.com/data-science/mad-over-mape-a86a8d831447?source=rss-2a43d9badb6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a86a8d831447</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[marketing-analytics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ridhima Kumar]]></dc:creator>
            <pubDate>Wed, 29 Apr 2020 18:16:12 GMT</pubDate>
            <atom:updated>2021-05-24T15:45:33.781Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>MAD over MAPE?</strong></h3><h4>Or which forecast accuracy metrics to use?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTFqLeJa3pqwgiIpxWHKvQ.png" /><figcaption>Source: <a href="https://www.arymalabs.com/">https://www.arymalabs.com/</a></figcaption></figure><p>Many CPG brands across the world would be focusing on keeping a tab on their sales and demand numbers during the Covid-19 pandemic. In my previous article, I had covered points on doing <a href="https://medium.com/aryma-labs/market-mix-modeling-mmm-in-times-of-covid-19-4703dd501034">Marketing Mix modeling during these testing times.</a></p><p>The brands might have already forecasted sales or demands for the first 3–4 months of 2020. But what could have been missed from their forecasts is the effect of Covid-19.</p><p>With the <a href="https://retail.economictimes.indiatimes.com/news/food-entertainment/personal-care-pet-supplies-liquor/coronavirus-stockpiling-drives-best-nestle-sales-growth-in-years/75348917">increase in sales</a> being reported by many brands, the forecasted sales would be way off the mark and there would be a huge divergence in the forecasted sales from actuals.</p><p>The situation calls for checking the forecast accuracy of the models.</p><p>In this article, I am going to discuss different forecast accuracy metrics and how to assess which of these forecast accuracy metrics would be the ideal one to choose.</p><p><strong>Let’s start with a brief overview of these metrics:</strong></p><ol><li><strong>MAD/MAE: </strong>This is calculated by subtracting the actual sales from forecasted sales. The error term is then converted to absolute error and the average of absolute errors is calculated for the whole time series.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*DplVnWI8mQGXTrMI7rKR1Q.png" /></figure><p>This forecast measure depends on the scale and the error term also has the same unit as the data. For e.g. if the sales volume is in Kg, then the error term would also be in Kg.</p><p>This method cannot be used to make comparison between time series which have different units e.g. sales volume (Kg) error cannot be compared with sales value (USD).</p><p>The drawback of this accuracy measure is that it averages out the error across the whole series which doesn’t give a very accurate result.</p><p>The error of 500 units might look very large when the sales are 2000 but the same error would be minuscule if the actual sales were 20,000.</p><p><strong>2. RMSE:</strong> Root mean square error is the square root of the average squared error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*rZDo7pPRXC0s81OE58kgmw.png" /></figure><p>Like MAE, this measure is scale dependent and cannot be used to make comparisons between series on different scales. And the error term also has the same unit as the data.</p><p><strong>3. MAPE:</strong> Mean Absolute Percentage Error is the most widely used measure for checking forecast accuracy. It comes under percentage errors which are scale independent and can be used for comparing series on different scales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*BaM5tsd63o3MW85rzpsVCQ.png" /></figure><p>where eᵢ is the error term and yᵢ is the actual data at time i.</p><p>The disadvantage of MAPE is that it becomes undefined if the value for actual figure is 0 for any observation in the data.</p><p><strong>4. MASE: </strong>Mean Absolute Scaled Error is a scale free error.</p><p>Basically, MASE is nothing but a ratio of MAE on test data divided by MAE using one-step naïve forecasting method on the training set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*RK1DHg-KiqQ7aaTmh9Nf7Q.png" /></figure><p>where,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*1iKvxXpTDUUEtdzf5hNFGA.png" /></figure><p>Here, Q is the naïve forecast computed on the training data. MAE is calculated on the test data and Q is calculated on the training data.</p><p>If MASE is less than 1, it means that the forecast is better than the one step naïve method on training data. If it is more than 1, it means that the forecast method is worse than the forecast using one step naïve forecasting approach on the training data.</p><p>To better understand this, below are the few links explaining the formula correctly:</p><p><a href="https://stats.stackexchange.com/questions/124365/interpretation-of-mean-absolute-scaled-error-mase">Interpretation of mean absolute scaled error (MASE)</a></p><p><a href="https://robjhyndman.com/papers/foresight.pdf">https://robjhyndman.com/papers/foresight.pdf</a></p><p>Now that we have the introduction to error metrics, let us see where each of these forecasting metrics work better or worse.</p><p><strong>Scenario 1: Forecast varying drastically from actuals</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*gIkRSME0wbihCm32HXyzVw.png" /></figure><p>Before Covid-19 is considered as training data and post covid-19 (March-20 to May-2020) is considered as test data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*Z_SvJv-hmEBghzkGQM-w0g.png" /></figure><p>In this scenario, MAPE can be used as a good accuracy measure since it is scale independent and can be used to compare different series or forecast scenarios.</p><p><strong>Scenario 2: Actuals plummeting to zero</strong></p><p><strong>Doesn’t the below graph remind of you something recent in the news ?…. If you guessed ‘Crude oil’ you would be correct !!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*uRZh-6_mrl4CoEtgioLSmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*9Rxy8obvcJzTMe03cQxMUA.png" /></figure><p>In this scenario, unfortunately the actuals plummet to zero (highly unexpected scenario) This scenario has been true for industries like Crude oil where the <a href="https://qz.com/1841668/oil-prices-are-negative-for-first-time-ever/">West Texas Intermediate (WTI) oil price benchmark plummeted to negative</a>, and also for automobile industry which has recently recorded zero sales for these months.</p><p>MAPE is not a good measure for this scenario as it becomes undefined<strong>.</strong></p><p>MAE or RMSE could be used for comparing forecast accuracy here. MASE also does not seem like a good KPI here as it is greater than 1. When MASE is greater than 1, it is implied that the method used for forecasting is worse than the naïve method used.</p><p><strong>Scenario 3: The ideal scenario (Back to normal scenario)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*Tp-L7se06FOMpk3xAOroDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*dl6axupIVzgA3tPj277mbA.png" /></figure><p>In this scenario, there is no covid-19 interference (oh how we wish for those normal days). The models are behaving properly. In this case, any measure can be used.</p><p><strong>References:</strong></p><ol><li><a href="https://robjhyndman.com/papers/forecast-accuracy.pdf">https://robjhyndman.com/papers/forecast-accuracy.pdf</a></li><li><a href="https://robjhyndman.com/papers/foresight.pdf">https://robjhyndman.com/papers/foresight.pdf</a></li><li><a href="https://qz.com/1841668/oil-prices-are-negative-for-first-time-ever/">https://qz.com/1841668/oil-prices-are-negative-for-first-time-ever/</a></li></ol><p>You can get in touch with me:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/ridhima-kumar7/">Ridhima Kumar</a></p><p>Twitter: <a href="https://twitter.com/kumar_ridhima">@kumar_ridhima</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a86a8d831447" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/mad-over-mape-a86a8d831447">MAD Over MAPE?</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>