<?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 Niladri Banerjee on Medium]]></title>
        <description><![CDATA[Stories by Niladri Banerjee on Medium]]></description>
        <link>https://medium.com/@questforspeed10?source=rss-d07b9d5ccff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fO5o1AorCXjtwtv0.</url>
            <title>Stories by Niladri Banerjee on Medium</title>
            <link>https://medium.com/@questforspeed10?source=rss-d07b9d5ccff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:48:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@questforspeed10/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[Yet another Churn blog!]]></title>
            <link>https://medium.com/godtlevert/yet-another-churn-blog-c52fd0a73e32?source=rss-d07b9d5ccff------2</link>
            <guid isPermaLink="false">https://medium.com/p/c52fd0a73e32</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[churn]]></category>
            <category><![CDATA[meal-kit]]></category>
            <dc:creator><![CDATA[Niladri Banerjee]]></dc:creator>
            <pubDate>Mon, 12 Dec 2022 13:23:52 GMT</pubDate>
            <atom:updated>2022-12-12T13:26:31.612Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*bAYDAOAEaEpp9wkS9PxxQg.png" /></figure><h3>Introduction</h3><p>So, churn…. isn’t there already like a whole ocean of articles devoted to this topic? So why <em>another churn article? </em>Give me 2 minutes and be illumined! Wisdom granted!</p><p>Well, jokes aside, it just signifies how important the topic is and just how many nuances there are to every churn project. Every company is different, every branch is different and so are the use-cases.</p><p>This article will seek to shed some light on how we go about it in the mealkit industry. Mealkits you say? Whatever on earth are those things? And why should anybody care?</p><p>Well, fair point so let me take a minute to explain that.</p><p>Mealkits as the name suggest are a brilliant way to a) save time b) eat delicious c) eat healthy d) maintain food budget e) reduce carbon footprint f) reduce food waste g) help the environment. And more. Much more.</p><p>Just imagine for yourself all the hassle it takes to figure out what to eat for dinner — something that needs to be done daily and must be tasty, healthy, not boring! And not necessarily in that order! Add kids and other family members into the mix and it can soon require the logistic planning of military general to get everyone satisfied.</p><p>Or.</p><p>Choose a mealkit- set your personal taste preferences and voilà! Food gets delivered to your door according to you and your family’s preferences and everybody is happy.</p><p>Unfortunately, as it so happens, people do tend to not see all the upsides of the product. And with that comes the phenomenon of churn- people who simply stop buying. And that brings us to the unique case of churn for mealkits. Or as we like to call it REACT. I leave it up to you to figure what that could stand for — but it is related to churn and attrition.</p><p>Right, so my 2 minutes are over and if you want to dive further, well read on!</p><h3>The technical bits</h3><p>How do we define churn was the most important part of the project. Because let us admit, when exactly does a person churn? When they stop ordering? What if they stop ordering for 4 weeks and then buy on the 5th week. Is that considered churn?</p><p>Together with business and project owners we produced a definition that works for our business and purposes. Something that has the crucial time element of customers who have stopped purchasing and are unlikely to purchase in the next N weeks.</p><p>Once the definition was set up, the next task was to fetch the all-important data and try and implement the definition in code and then check if the behaviour of customers was possible to predict at all!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*CkM_Ue9gENySCrBgTh0loQ.png" /><figcaption><em>🔮 Yes…we know you will keep reading… 🔮</em></figcaption></figure><p>We considered for the first version of our crystal ball quite a few input variables including demographic data which we obtain through third party aggregators. Perhaps the fact they were aggregated data, but we found no predictive power whatsoever in them. Or maybe we simply needed to perform more feature engineering.</p><p>Anyhow, experimenting with various combinations of models and inputs and eliminating those that had limited to no predictive power, we were quite happy with the first version of the model using logistic regression.</p><h3>Data</h3><p>Any discussion of churn is of course incomplete without discussing the datasets that are going into the prediction module.</p><p>In total, in the first version of the model, we used 6 variables which we found was either protective or non-protective of churn. As an example, the following image shows a customer which the model predicts will <em>not </em>churn: -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wFJoi1o8lPrGQDOI3D8Qag.png" /></figure><p>When taken across the full training cohort, so the analysis appears as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FKnkzOPLaEBc9uOGGoiZhg.png" /></figure><p>Common thread amongst all the relevant variables was the aspect of time — how long a customer has been with us, how many orders were taken, when was the last time an order was placed and how long has it been since the last complaint was sent in.</p><p>We also analysed the performance of the model in real-time, monitoring the prediction and order frequency of cohorts marked at risk for churning vs not-churning. We were quite reasonably pleased(?) that we were actually managing to capture at-risk churn customers!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*-WwfE96Hh6_lINO2YWoBZw.png" /><figcaption><em>Order frequency between different churn cohorts</em></figcaption></figure><p>And finally, to wrap up the discussion, here is the rough birds-eye view of the full end to end machine-learning pipeline:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*pPPnLPw2pLil8N1Lj_rfPw.png" /></figure><p>As can be inferred, there are quite a few components of the pipeline but in brief they can be understood as follows:</p><ul><li><strong>Python:</strong> no brainer, the code is written in python using scikit-learn. Yes, sometimes the simplest solution works.</li><li><strong>Azure repos:</strong> Code base is stored in the git enabled repository</li><li><strong>Azure DevOps</strong>: Our master coordinator that connects and brings the code for execution into the Databricks workspace</li><li><strong>Databricks:</strong> while being primarily a distributed environment (Spark), we have restricted it to work more as a scheduler, automating the execution of various ML jobs written in Python. We have not found it beneficial to refactor the code to PySpark.</li><li><strong>Azure SQL Database: </strong>The output of the predictions is sent to our database customised for ML workloads.</li><li><strong>PostgresDB: </strong>Our customer data platform does not support direct reads from Azure and thus we use pipelines in Azure Data Factory to pipe the predictions to postgresDB formatted in a way that CRM teams can use the predictions out of the box</li><li><strong>Segment — </strong>Our customer data platform that works as a landing stage for both incoming (e.g., web data) and outgoing data (e.g., predictions/annotations).</li><li><strong>Customer.io</strong>: Tool used by the CRM to receive customer specific insights. It is here they receive the likelihood of a customer churning in the next N weeks displayed as an attribute. They can subsequently run targeted churn-mitigation campaigns on diverse groups of customers.</li></ul><h3>Future Work</h3><p>Even though we recently put the model to production, our work is not complete yet. Amongst the most important development required going forward –</p><ul><li><strong>Weekly churn threshold — </strong>Every week the churn distribution changes shape and thereby the underlying distribution of churn risk scores. It needs to be evaluated if this weekly variation has any practical significance in our ability to predict churn. What complicates the issue is the fact that the churn scores predict N weeks in the future and thereby determining the exact consequence of variation in scores is no trivial task. But there are ways to approach this, all from simple frequentist methods to more sophisticated Bayesian approaches.</li><li><strong>Seasonal variation — </strong>In addition to weekly variation, we expect variation in seasons. This is because historically we know there are periods when customers do not take orders but at the same time not necessarily churn e.g., holiday periods. One of the future iterations of the model will take the seasonality into account.</li><li><strong>Monitoring </strong>— We also need to set up monitoring of customers with high churn scores that eventually do churn. At the same time, internal communication feedback loops from the CRM team on retention will be another vital information to monitor. Furthermore, going forward it will be interesting to uncover trends if any, on the kind of customers who do churn vs those who respond to anti-churn measures.</li><li><strong>Additional features — </strong>We still have a fair number of variables and features we would like to explore if it helps improve the churn model and/or retention metrics. These include but are not limited to different demographic data and information on the types of mealkit combinations/frequencies/sizes etc. In addition, we have anonymised web data that could be interesting to take a deep-dive and check if they have any role in prediction of churn.</li><li><strong>Model tuning — </strong>At present we have tuned a Logistic Regression model to perform the job. While we have analysed some other models, this has not been prioritised in the first phase of the project and will be required for us to be sure we have the best model always working under the hood.</li><li><strong>MLOps — </strong>Lastly, a good deal of work remains on the ‘OPS’ side of things- everything from Data Ops to MLOps whereby monitoring of data drift, model drift, prediction drift needs to be in place.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c52fd0a73e32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/godtlevert/yet-another-churn-blog-c52fd0a73e32">Yet another Churn blog!</a> was originally published in <a href="https://medium.com/godtlevert">Cheffelo  — Tech &amp; Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>